Skip to content

Commit

Permalink
tools/check-code.sh: Tighten function call in for loop check
Browse files Browse the repository at this point in the history
The new ipt linting rule ReadabilityMissingParenthesis creates code like

for(i = oldSize; i < (arrayIndex + 1); i += 1)

which is without the fix being complained at.
  • Loading branch information
t-b committed Feb 13, 2025
1 parent 45623c9 commit 72e1a1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/check-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ then
fi

# U means non-greedy matching
matches=$(git grep $opts -e '^(?U)[[:space:]]*for\(.*\(.*\).*\)' --and -e ';' --and --not -e ':' --and --not -e '//[[:space:]]*NOLINT$' '*/MIES_*.ipf')
matches=$(git grep $opts -e '^(?U)[[:space:]]*for\(.*[a-z]+\(.*\).*\)' --and -e ';' --and --not -e ':' --and --not -e '//[[:space:]]*NOLINT$' '*/MIES_*.ipf')

if [[ -n "$matches" ]]
then
Expand Down

0 comments on commit 72e1a1a

Please sign in to comment.