We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cacf8c6 commit 722f61dCopy full SHA for 722f61d
check-grammars-crates.sh
@@ -107,8 +107,13 @@ if [ "$(ls -A $COMPARE)" ]; then
107
for METRIC in "${METRICS[@]}"
108
do
109
110
- PREFIX_METRIC="\.$METRIC"
111
- FILES=`grep -r -l $PREFIX_METRIC $COMPARE | head -$MT_THRESHOLD`
+ # Find metrics as whole words
+ MATCH_PATTERN="\b\.$METRIC\b"
112
+ # Exclude common patterns, present in minimal tests code, that
113
+ # could deceive the metric difference detector
114
+ # i.e metric_name(), .metric_name()
115
+ EXCLUDE_PATTERN="$METRIC("
116
+ FILES=`grep -r -L $EXCLUDE_PATTERN $COMPARE | xargs grep -l $MATCH_PATTERN 2>/dev/null | head -$MT_THRESHOLD`
117
if [ -n "$FILES" ]
118
then
119
mkdir -p $OUTPUT_DIR/$METRIC
0 commit comments