Skip to content

Commit 32bf4c6

Browse files
author
MarcoFalke
committed
Merge #13450: Add linter: Enforce the source code file naming convention described in the developer notes
ad691f6 Add linter: Enforce the source code file naming convention described in the developer notes (practicalswift) Pull request description: Add linter: Enforce the source code file naming convention described in the developer notes. Tree-SHA512: 6458acf5383de7e81554bdd954c3a74c2bbf26286687ea69d934f11174d2f6bd573e8d2c16a7e77bbd12065e65be7700ecd7791d215f286e18f346bf964cd17d
2 parents 9501938 + ad691f6 commit 32bf4c6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/lint/lint-filenames.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (c) 2018 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
#
7+
# Make sure only lowercase alphanumerics (a-z0-9), underscores (_),
8+
# hyphens (-) and dots (.) are used in source code filenames.
9+
10+
export LC_ALL=C
11+
12+
EXIT_CODE=0
13+
OUTPUT=$(git ls-files -- "*.cpp" "*.h" "*.py" "*.sh" | grep -vE '^[a-z0-9_./-]+$' | grep -vE 'src/(secp256k1|univalue)/')
14+
if [[ ${OUTPUT} != "" ]]; then
15+
echo "Use only lowercase alphanumerics (a-z0-9), underscores (_), hyphens (-) and dots (.)"
16+
echo "in source code filenames:"
17+
echo
18+
echo "${OUTPUT}"
19+
EXIT_CODE=1
20+
fi
21+
exit ${EXIT_CODE}

0 commit comments

Comments
 (0)