aboutsummaryrefslogtreecommitdiff
path: root/test/lint
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-06-24 18:33:53 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-06-24 18:39:27 +0200
commit9ab4c2a2465846ff6176aff88bc5b7bef4d2cc15 (patch)
tree6f84e8bd2b1cfc7a9b5c717c15e1ed09b554728f /test/lint
parent66e1a08d6fbf39b5971add2aa221d3c39805c01e (diff)
parent927e1150bc207181f7d5b0948e87d04b737a1c27 (diff)
downloadbitcoin-9ab4c2a2465846ff6176aff88bc5b7bef4d2cc15.tar.xz
Merge #13496: Test: Harden lint-filenames.sh
927e1150bc207181f7d5b0948e87d04b737a1c27 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
Diffstat (limited to 'test/lint')
-rwxr-xr-xtest/lint/lint-filenames.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/lint/lint-filenames.sh b/test/lint/lint-filenames.sh
index 0a28ab091a..5391e43d91 100755
--- a/test/lint/lint-filenames.sh
+++ b/test/lint/lint-filenames.sh
@@ -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:"