Skip to content

Commit

Permalink
ci: improve files checked gh-action test
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa committed Feb 10, 2022
1 parent 5cb28ea commit 89696f9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -29,8 +29,17 @@ jobs:
run: |
expected_files=(num_guess.py num_guess.ipynb subfolder/queen_problem.py subfolder/queen_problem.ipynb)
checked_files=(${{ env.BLACK_CHECK_FILE_PATHS }})
# Check whether the expected files are checked
for file in ${expected_files[@]}; do
if ! [[ " ${checked_files[*]} " == *"${file}"* ]]; then
echo "Black forgot to check file ${file}!"
exit 1
fi
done
# Check whether black checks files that should not be checked
for file in ${checked_files[@]}; do
if ! [[ " ${expected_files[*]} " == *"$file"* ]]; then
if ! [[ " ${expected_files[*]} " == *"${file}"* ]]; then
echo "Unexpected file ${file} got checked!"
exit 1
fi
Expand Down

0 comments on commit 89696f9

Please sign in to comment.