0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

Merge bitcoin/bitcoin#25042: lint: Fix lint-circular-dependencies.py file list

fad0abf539 lint: Fix lint-circular-dependencies.py file list (MacroFake)

Pull request description:

  currently in-tree files like `wallet/test/fuzz/coinselection.cpp` are missed. Also out-of-tree files like `test/data/bip341_wallet_vectors.json.h` or `qt/moc_qvaluecombobox.cpp` are included.

  Change the script to only use in-tree files.

  Also, change `'python3'` to `sys.executable`.

ACKs for top commit:
  laanwj:
    Code review ACK fad0abf539

Tree-SHA512: baf150fbae6a7120b2692f2eaef6a7773f2681e1610f8776f8d2ae6736c74736502a505df080b2182880f753b90f94e76a1e365fb45185f46f0e4d5521ca8e86
This commit is contained in:
laanwj 2022-05-02 16:34:41 +02:00
commit 037c5e511f
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D
2 changed files with 7 additions and 11 deletions

View file

@ -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,

View file

@ -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,