Skip to content

Commit

Permalink
Merge #13496: Test: Harden lint-filenames.sh
Browse files Browse the repository at this point in the history
927e115 Test: Harden lint-filenames.sh (wodry)

Pull request description:

  - This fixes that only files with lower case file name suffix where found before, which contradicted the Regex to find uppercase characters in file names (including suffixes I guess).
  - `--full-name` switch was added to git ls-files, to define that the found file always includes it's full path in the git project.
  - since we know now that the file name includes the full path, we can harden the Regex to exclude the  secp256k1 and univalue sub folders.
  - use backslash line break to make code easier to read and avoid too long line.

Tree-SHA512: 9b55fe4965ae2084112b9f8a81bf9c657756c2cb5004986e7b6102a76adaf62c7d7a53257d9f13c5d8a1c75870b52c744d13830e3edd454a099e810357c914e5
  • Loading branch information
laanwj committed Jun 24, 2018
2 parents 66e1a08 + 927e115 commit 9ab4c2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/lint/lint-filenames.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
export LC_ALL=C

EXIT_CODE=0
OUTPUT=$(git ls-files -- "*.cpp" "*.h" "*.py" "*.sh" | grep -vE '^[a-z0-9_./-]+$' | grep -vE 'src/(secp256k1|univalue)/')
OUTPUT=$(git ls-files --full-name -- "*.[cC][pP][pP]" "*.[hH]" "*.[pP][yY]" "*.[sS][hH]" | \
grep -vE '^[a-z0-9_./-]+$' | \
grep -vE '^src/(secp256k1|univalue)/')

if [[ ${OUTPUT} != "" ]]; then
echo "Use only lowercase alphanumerics (a-z0-9), underscores (_), hyphens (-) and dots (.)"
echo "in source code filenames:"
Expand Down

0 comments on commit 9ab4c2a

Please sign in to comment.