Skip to content

Commit c65b907

Browse files
committed
Use the new script in the metric-checker
1 parent d24569c commit c65b907

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

check-grammars-crates.sh

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -92,29 +92,12 @@ if [ "$(ls -A $COMPARE)" ]; then
9292
# Maximum number of considered minimal tests for a metric
9393
MT_THRESHOLD=30
9494

95-
# Array containing the considered metrics
96-
# TODO: Implement a command into rust-code-analysis-cli that returns all
97-
# computed metrics https://github.com/mozilla/rust-code-analysis/issues/478
98-
METRICS=("cognitive" "sloc" "ploc" "lloc" "cloc" "blank" "cyclomatic" "halstead" "nom" "nexits" "nargs")
99-
100-
# Output directory name
95+
# Output directory path
10196
OUTPUT_DIR=/tmp/output-$TREE_SITTER_CRATE
10297

103-
# Create output directory
104-
mkdir -p $OUTPUT_DIR
105-
106-
# Retrieve minimal tests for a metric
107-
for METRIC in "${METRICS[@]}"
108-
do
109-
110-
PREFIX_METRIC="\.$METRIC"
111-
FILES=`grep -r -i -l $PREFIX_METRIC $COMPARE | head -$MT_THRESHOLD`
112-
if [ -n "$FILES" ]
113-
then
114-
mkdir -p $OUTPUT_DIR/$METRIC
115-
cp $FILES $OUTPUT_DIR/$METRIC
116-
fi
117-
done
98+
# Split files into distinct directories depending on
99+
# their metric differences
100+
./split-minimal-tests.py -i $COMPARE -o $OUTPUT_DIR -t $MT_THRESHOLD
118101

119102
tar -czvf /tmp/json-diffs-and-minimal-tests.tar.gz $COMPARE $OUTPUT_DIR
120103
fi

0 commit comments

Comments
 (0)