Rename the tool to lucisv (Language Utility for Coding In SystemVerilog)
This commit is contained in:
1 parent
a284e33110
commit
eeaffafd56
188 files changed
+2825
-2802
No files matched your search
+11
-11
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# Score vfmt against the corpus: one JSON line on stdout.
|
||||
# Score lucisv against the corpus: one JSON line on stdout.
|
||||
#
|
||||
# {"passing":N,"total":N,"pct":P,"failures_by_category":{"<cat>":N,...}}
|
||||
#
|
||||
# A file *passes* when the formatter accepts it (`vfmt --check` exits 0 or 1 --
|
||||
# A file *passes* when the formatter accepts it (`lucisv --check` exits 0 or 1 --
|
||||
# i.e. it parsed, and the runtime safety net verified the output) AND the
|
||||
# linter runs over it without an internal error (`vfmt check` exits 0 or 1).
|
||||
# linter runs over it without an internal error (`lucisv check` exits 0 or 1).
|
||||
# Exit 2 or a signal death on either side is a failure. The corpus is never
|
||||
# written to (only --check / check are used, with --no-cache).
|
||||
#
|
||||
@@ -15,28 +15,28 @@
|
||||
# name is stable even when its count is zero -- zero-count categories are
|
||||
# simply absent from the JSON.
|
||||
#
|
||||
# Usage: scripts/score.sh [corpus-dir] [-b vfmt-binary] [-j jobs] [-o details.tsv]
|
||||
# Usage: scripts/score.sh [corpus-dir] [-b lucisv-binary] [-j jobs] [-o details.tsv]
|
||||
# details.tsv: outcome<TAB>category<TAB>file<TAB>message, one row per file
|
||||
# (default .score-results.tsv, gitignored).
|
||||
|
||||
set -eu
|
||||
|
||||
corpus_dir=corpus
|
||||
vfmt=target/release/vfmt
|
||||
lucisv=target/release/lucisv
|
||||
jobs=$( (sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4) )
|
||||
details=.score-results.tsv
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
-b) vfmt=$2; shift 2 ;;
|
||||
-b) lucisv=$2; shift 2 ;;
|
||||
-j) jobs=$2; shift 2 ;;
|
||||
-o) details=$2; shift 2 ;;
|
||||
-*) echo "usage: $0 [corpus-dir] [-b vfmt] [-j jobs] [-o details.tsv]" >&2; exit 2 ;;
|
||||
-*) echo "usage: $0 [corpus-dir] [-b lucisv] [-j jobs] [-o details.tsv]" >&2; exit 2 ;;
|
||||
*) corpus_dir=$1; shift ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -x "$vfmt" ] || { echo "no vfmt binary at $vfmt (cargo build --release?)" >&2; exit 2; }
|
||||
[ -x "$lucisv" ] || { echo "no lucisv binary at $lucisv (cargo build --release?)" >&2; exit 2; }
|
||||
[ -d "$corpus_dir" ] || { echo "no corpus at $corpus_dir (tools/corpus_fetch.sh?)" >&2; exit 2; }
|
||||
|
||||
# --- per-file classification --------------------------------------------------
|
||||
@@ -128,11 +128,11 @@ classify() {
|
||||
check_one() {
|
||||
file=$1
|
||||
status=0
|
||||
out=$("$vfmt" --no-cache --check "$file" 2>&1) || status=$?
|
||||
out=$("$lucisv" --no-cache --check "$file" 2>&1) || status=$?
|
||||
case $status in
|
||||
0|1)
|
||||
lstatus=0
|
||||
lout=$("$vfmt" check --no-cache "$file" 2>&1 >/dev/null) || lstatus=$?
|
||||
lout=$("$lucisv" check --no-cache "$file" 2>&1 >/dev/null) || lstatus=$?
|
||||
case $lstatus in
|
||||
0|1) printf 'pass\t-\t%s\t\n' "$file" ;;
|
||||
2) msg=$(printf '%s\n' "$lout" | grep '^error: ' | head -1 | tr '\t\n' ' ')
|
||||
@@ -156,7 +156,7 @@ check_one() {
|
||||
}
|
||||
|
||||
export -f classify check_one
|
||||
export vfmt
|
||||
export lucisv
|
||||
|
||||
tmp=$(mktemp)
|
||||
trap 'rm -f "$tmp"' EXIT
|
||||
|
||||
Reference in new issue
Block a user