Skip to content

Commit fae211c

Browse files
author
MarcoFalke
committed
lint: Start to use py lint scripts
1 parent fa82e89 commit fae211c

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

test/lint/lint-all.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Distributed under the MIT software license, see the accompanying
55
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
66
#
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
88
# with a non-zero status code.
99

1010
# This script is intentionally locale dependent by not setting "export LC_ALL=C"
@@ -18,7 +18,7 @@ LINTALL=$(basename "${BASH_SOURCE[0]}")
1818

1919
EXIT_CODE=0
2020

21-
for f in "${SCRIPTDIR}"/lint-*.sh; do
21+
for f in "${SCRIPTDIR}"/lint-*; do
2222
if [ "$(basename "$f")" != "$LINTALL" ]; then
2323
if ! "$f"; then
2424
echo "^---- failure generated from $f"

test/lint/lint-files.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from subprocess import check_output
1414
from typing import Optional, NoReturn
1515

16+
CMD_TOP_LEVEL = ["git", "rev-parse", "--show-toplevel"]
1617
CMD_ALL_FILES = "git ls-files -z --full-name"
1718
CMD_SOURCE_FILES = 'git ls-files -z --full-name -- "*.[cC][pP][pP]" "*.[hH]" "*.[pP][yY]" "*.[sS][hH]"'
1819
CMD_SHEBANG_FILES = "git grep --full-name --line-number -I '^#!'"
@@ -184,6 +185,8 @@ def check_shebang_file_permissions() -> int:
184185

185186

186187
def main() -> NoReturn:
188+
root_dir = check_output(CMD_TOP_LEVEL).decode("utf8").strip()
189+
os.chdir(root_dir)
187190
failed_tests = 0
188191
failed_tests += check_all_filenames()
189192
failed_tests += check_source_filenames()

test/lint/lint-files.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)