Skip to content

Commit

Permalink
test: Fix eslint invocation in static-code
Browse files Browse the repository at this point in the history
`find_scripts()` previously only accepted two arguments, i.e. one glob.
Make it accept many, which will make test_eslint() *actually* cover
`*.jsx` files.
  • Loading branch information
martinpitt committed Feb 7, 2024
1 parent 9b5becf commit 005cff4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/static-code
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ find_scripts() {
(
# Any non-binary file which contains a given shebang
git grep --cached -lIz '^#!.*'"$1"
# Any file matching the provided glob
git ls-files -z "$2"
shift
# Any file matching the provided globs
git ls-files -z "$@"
) | sort -z | uniq -z
}

Expand Down Expand Up @@ -80,7 +81,7 @@ test_js_translatable_strings() {
if [ "${WITH_PARTIAL_TREE:-0}" = 0 ]; then
test_eslint() {
test -x node_modules/.bin/eslint -a -x /usr/bin/node || skip 'no eslint'
find_scripts 'node' '*.js' '*.js?' | xargs -0 node_modules/.bin/eslint
find_scripts 'node' '*.js' '*.jsx' | xargs -0 node_modules/.bin/eslint
}
fi

Expand Down

0 comments on commit 005cff4

Please sign in to comment.