Skip to content

Commit

Permalink
DAOS-16875 cq: fix flake8 xargs usage (#15608) (#15614)
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.

Signed-off-by: Dalton Bohning <[email protected]>
  • Loading branch information
daltonbohning authored Dec 13, 2024
1 parent bdea4aa commit d093763
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 d093763

Please sign in to comment.