Browse Source

Fix bashate xargs run

Bashate does not fail for "E004 File did not end with a newline"
properly unless the file is the last in the list when multiple
check files are provided (as we do with xargs). Since the file order
is random, if only 1 or 2 files are failing, this can cause very
random linter failures.

The solution is to use 'xargs -n1' to pass only 1 file to each
bashate process.

See also https://review.openstack.org/#/c/614542/

Change-Id: I2186795510c2327571e7631b45de8a112f4d4445
Logan V 1 month ago
parent
commit
86a697cf4b
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      test-bashate.sh

+ 1
- 1
test-bashate.sh View File

@@ -49,4 +49,4 @@ grep --recursive --binary-files=without-match \
49 49
      --files-with-match '^.!.*\(ba\)\?sh$' \
50 50
      --exclude-dir .tox \
51 51
      --exclude-dir .git \
52
-     "${WORKING_DIR}" | xargs bashate --error . --verbose --ignore=E003,E006,E040
52
+     "${WORKING_DIR}" | xargs -n1 bashate --error . --verbose --ignore=E003,E006,E040

Loading…
Cancel
Save