Skip to content

Commit

Permalink
tools/test [nfc]: Push files_* calls down into remaining suites
Browse files Browse the repository at this point in the history
This makes all the suites' runners parallel to each other in shape.
  • Loading branch information
gnprice committed Nov 17, 2022
1 parent fbf737a commit f3aad7e
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions tools/test
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ run_native() {

run_lint() {
local files
files=( $(apply_eslintignore "$@") )
files=( $(files_js) )
files=( $(apply_eslintignore "${files[@]}") )
(( ${#files[@]} )) || return 0
eslint ${fix:+--fix} --report-unused-disable-directives --max-warnings=0 "${files[@]}"
}
Expand Down Expand Up @@ -239,9 +240,10 @@ run_jest() {
}

run_prettier() {
(( $# )) || return 0
local patterns
patterns=( "${@/%\///**/*.js}" ) # replace trailing `/` with `/**/*.js`
patterns=( $(files_js_jsflow) )
(( ${#patterns[@]} )) || return 0
patterns=( "${patterns[@]/%\///**/*.js}" ) # replace trailing `/` with `/**/*.js`
# Workaround for https://github.com/prettier/prettier-eslint-cli/issues/205
patterns=( "${patterns[@]/#/$rootdir/}" )
prettier-eslint \
Expand Down Expand Up @@ -291,27 +293,13 @@ failed=()
for suite in "${suites[@]}"; do
echo "Running $suite..."
case "$suite" in
native)
run_native
;;
flow)
flow
;;
lint)
run_lint $(files_js)
;;
jest)
run_jest
;;
prettier)
run_prettier $(files_js_jsflow)
;;
deps)
run_deps
;;
tsflower)
run_tsflower
;;
native) run_native ;;
flow) flow ;;
lint) run_lint ;;
jest) run_jest ;;
prettier) run_prettier ;;
deps) run_deps ;;
tsflower) run_tsflower ;;
esac || failed+=($suite)
done

Expand Down

0 comments on commit f3aad7e

Please sign in to comment.