diff options
author | MacroFake <falke.marco@gmail.com> | 2022-04-30 11:24:36 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-04-30 11:16:44 +0200 |
commit | fad0abf539dc2141a3937f040e16703e38654fe3 (patch) | |
tree | 117757f1dfeedba9d64991490872d24321e9a259 /test | |
parent | becea48fe07287d395560048f55aa61bf10888f4 (diff) |
lint: Fix lint-circular-dependencies.py file list
Diffstat (limited to 'test')
-rwxr-xr-x | test/lint/lint-circular-dependencies.py | 16 | ||||
-rwxr-xr-x | test/lint/lint-format-strings.py | 2 |
2 files changed, 7 insertions, 11 deletions
diff --git a/test/lint/lint-circular-dependencies.py b/test/lint/lint-circular-dependencies.py index e04909c0a5..7ca2ec994b 100755 --- a/test/lint/lint-circular-dependencies.py +++ b/test/lint/lint-circular-dependencies.py @@ -6,7 +6,6 @@ # # Check for circular dependencies -import glob import os import re import subprocess @@ -32,17 +31,14 @@ CODE_DIR = "src" def main(): circular_dependencies = [] exit_code = 0 - os.chdir( - CODE_DIR - ) # We change dir before globbing since glob.glob's root_dir option is only available in Python 3.10 - # Using glob.glob since subprocess.run's globbing won't work without shell=True - files = [] - for path in ["*", "*/*", "*/*/*"]: - for extension in ["h", "cpp"]: - files.extend(glob.glob(f"{path}.{extension}")) + os.chdir(CODE_DIR) + files = subprocess.check_output( + ['git', 'ls-files', '--', '*.h', '*.cpp'], + universal_newlines=True, + ).splitlines() - command = ["python3", "../contrib/devtools/circular-dependencies.py", *files] + command = [sys.executable, "../contrib/devtools/circular-dependencies.py", *files] dependencies_output = subprocess.run( command, stdout=subprocess.PIPE, diff --git a/test/lint/lint-format-strings.py b/test/lint/lint-format-strings.py index 5a36da11fd..28e7b1e4ff 100755 --- a/test/lint/lint-format-strings.py +++ b/test/lint/lint-format-strings.py @@ -36,7 +36,7 @@ RUN_LINT_FILE = 'test/lint/run-lint-format-strings.py' def check_doctest(): command = [ - 'python3', + sys.executable, '-m', 'doctest', RUN_LINT_FILE, |