File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change 4
4
# Distributed under the MIT software license, see the accompanying
5
5
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6
6
#
7
- # This script runs all contrib/devtools/lint-*.sh files, and fails if any exit
7
+ # This script runs all contrib/devtools/lint-* files, and fails if any exit
8
8
# with a non-zero status code.
9
9
10
10
# This script is intentionally locale dependent by not setting "export LC_ALL=C"
@@ -18,7 +18,7 @@ LINTALL=$(basename "${BASH_SOURCE[0]}")
18
18
19
19
EXIT_CODE=0
20
20
21
- for f in " ${SCRIPTDIR} " /lint-* .sh ; do
21
+ for f in " ${SCRIPTDIR} " /lint-* ; do
22
22
if [ " $( basename " $f " ) " != " $LINTALL " ]; then
23
23
if ! " $f " ; then
24
24
echo " ^---- failure generated from $f "
Original file line number Diff line number Diff line change 13
13
from subprocess import check_output
14
14
from typing import Optional , NoReturn
15
15
16
+ CMD_TOP_LEVEL = ["git" , "rev-parse" , "--show-toplevel" ]
16
17
CMD_ALL_FILES = "git ls-files -z --full-name"
17
18
CMD_SOURCE_FILES = 'git ls-files -z --full-name -- "*.[cC][pP][pP]" "*.[hH]" "*.[pP][yY]" "*.[sS][hH]"'
18
19
CMD_SHEBANG_FILES = "git grep --full-name --line-number -I '^#!'"
@@ -184,6 +185,8 @@ def check_shebang_file_permissions() -> int:
184
185
185
186
186
187
def main () -> NoReturn :
188
+ root_dir = check_output (CMD_TOP_LEVEL ).decode ("utf8" ).strip ()
189
+ os .chdir (root_dir )
187
190
failed_tests = 0
188
191
failed_tests += check_all_filenames ()
189
192
failed_tests += check_source_filenames ()
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments