mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-01 08:24:21 +01:00
lint: Start to use py lint scripts
This commit is contained in:
@@ -13,6 +13,7 @@ import sys
|
||||
from subprocess import check_output
|
||||
from typing import Optional, NoReturn
|
||||
|
||||
CMD_TOP_LEVEL = ["git", "rev-parse", "--show-toplevel"]
|
||||
CMD_ALL_FILES = "git ls-files -z --full-name"
|
||||
CMD_SOURCE_FILES = 'git ls-files -z --full-name -- "*.[cC][pP][pP]" "*.[hH]" "*.[pP][yY]" "*.[sS][hH]"'
|
||||
CMD_SHEBANG_FILES = "git grep --full-name --line-number -I '^#!'"
|
||||
@@ -184,6 +185,8 @@ def check_shebang_file_permissions() -> int:
|
||||
|
||||
|
||||
def main() -> NoReturn:
|
||||
root_dir = check_output(CMD_TOP_LEVEL).decode("utf8").strip()
|
||||
os.chdir(root_dir)
|
||||
failed_tests = 0
|
||||
failed_tests += check_all_filenames()
|
||||
failed_tests += check_source_filenames()
|
||||
|
||||
Reference in New Issue
Block a user