Changeset View
Changeset View
Standalone View
Standalone View
test/lint/check-doc.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2019 The Bitcoin Core developers | # Copyright (c) 2015-2019 The Bitcoin Core developers | ||||
# Copyright (c) 2019 The Bitcoin developers | # Copyright (c) 2019 The Bitcoin developers | ||||
# 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 checks if all command line args are documented. | This checks if all command line args are documented. | ||||
Return value is 0 to indicate no error. | Return value is 0 to indicate no error. | ||||
Author: @MarcoFalke | Author: @MarcoFalke | ||||
''' | ''' | ||||
from subprocess import check_output | |||||
from pprint import PrettyPrinter | |||||
import glob | import glob | ||||
import re | import re | ||||
from pprint import PrettyPrinter | |||||
from subprocess import check_output | |||||
TOP_LEVEL = 'git rev-parse --show-toplevel' | TOP_LEVEL = 'git rev-parse --show-toplevel' | ||||
FOLDER_SRC = '/src/**/' | FOLDER_SRC = '/src/**/' | ||||
FOLDER_TEST = '/src/**/test/' | FOLDER_TEST = '/src/**/test/' | ||||
EXTENSIONS = ["*.c", "*.h", "*.cpp", "*.cc", "*.hpp"] | EXTENSIONS = ["*.c", "*.h", "*.cpp", "*.cc", "*.hpp"] | ||||
REGEX_ARG = r'(?:ForceSet|SoftSet|Get|Is)(?:Bool)?Args?(?:Set)?\(\s*"(-[^"]+)"' | REGEX_ARG = r'(?:ForceSet|SoftSet|Get|Is)(?:Bool)?Args?(?:Set)?\(\s*"(-[^"]+)"' | ||||
REGEX_DOC = r'AddArg\(\s*"(-[^"=]+?)(?:=|")' | REGEX_DOC = r'AddArg\(\s*"(-[^"=]+?)(?:=|")' | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |