mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-18 12:53:03 +02:00
lint: Start to use py lint scripts
This commit is contained in:
parent
fa82e890e7
commit
fae211c0ae
@ -4,7 +4,7 @@
|
|||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
#
|
#
|
||||||
# This script runs all contrib/devtools/lint-*.sh files, and fails if any exit
|
# This script runs all contrib/devtools/lint-* files, and fails if any exit
|
||||||
# with a non-zero status code.
|
# with a non-zero status code.
|
||||||
|
|
||||||
# This script is intentionally locale dependent by not setting "export LC_ALL=C"
|
# This script is intentionally locale dependent by not setting "export LC_ALL=C"
|
||||||
@ -18,7 +18,7 @@ LINTALL=$(basename "${BASH_SOURCE[0]}")
|
|||||||
|
|
||||||
EXIT_CODE=0
|
EXIT_CODE=0
|
||||||
|
|
||||||
for f in "${SCRIPTDIR}"/lint-*.sh; do
|
for f in "${SCRIPTDIR}"/lint-*; do
|
||||||
if [ "$(basename "$f")" != "$LINTALL" ]; then
|
if [ "$(basename "$f")" != "$LINTALL" ]; then
|
||||||
if ! "$f"; then
|
if ! "$f"; then
|
||||||
echo "^---- failure generated from $f"
|
echo "^---- failure generated from $f"
|
||||||
|
@ -13,6 +13,7 @@ import sys
|
|||||||
from subprocess import check_output
|
from subprocess import check_output
|
||||||
from typing import Optional, NoReturn
|
from typing import Optional, NoReturn
|
||||||
|
|
||||||
|
CMD_TOP_LEVEL = ["git", "rev-parse", "--show-toplevel"]
|
||||||
CMD_ALL_FILES = "git ls-files -z --full-name"
|
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_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 '^#!'"
|
CMD_SHEBANG_FILES = "git grep --full-name --line-number -I '^#!'"
|
||||||
@ -184,6 +185,8 @@ def check_shebang_file_permissions() -> int:
|
|||||||
|
|
||||||
|
|
||||||
def main() -> NoReturn:
|
def main() -> NoReturn:
|
||||||
|
root_dir = check_output(CMD_TOP_LEVEL).decode("utf8").strip()
|
||||||
|
os.chdir(root_dir)
|
||||||
failed_tests = 0
|
failed_tests = 0
|
||||||
failed_tests += check_all_filenames()
|
failed_tests += check_all_filenames()
|
||||||
failed_tests += check_source_filenames()
|
failed_tests += check_source_filenames()
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Copyright (c) 2021 The Bitcoin Core developers
|
|
||||||
# Distributed under the MIT software license, see the accompanying
|
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
||||||
|
|
||||||
export LC_ALL=C
|
|
||||||
|
|
||||||
set -e
|
|
||||||
cd "$(dirname "$0")/../.."
|
|
||||||
test/lint/lint-files.py
|
|
Loading…
x
Reference in New Issue
Block a user