Skip to content

Commit

Permalink
DAOS-16875 cq: fix flake8 xargs usage (#15608)
Browse files Browse the repository at this point in the history
Use -r so if no scons or non-scons files are grep'ed, flake8 does not
run.

Skip-build: true

Required-githooks: true

Signed-off-by: Dalton Bohning <[email protected]>
  • Loading branch information
daltonbohning committed Dec 13, 2024
1 parent bdea4aa commit c59b33e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/githooks/pre-commit.d/71-flake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ else
rc=0

# non-scons
if ! echo "$py_files" | grep -vi scons | xargs flake8 --config .flake8; then
if ! echo "$py_files" | grep -vi scons | xargs -r flake8 --config .flake8; then
rc=1
fi

# scons
if ! echo "$py_files" | grep -i scons | xargs flake8 --config .flake8-scons; then
if ! echo "$py_files" | grep -i scons | xargs -r flake8 --config .flake8-scons; then
rc=1;
fi

Expand Down

0 comments on commit c59b33e

Please sign in to comment.