Changeset View
Changeset View
Standalone View
Standalone View
test/lint/check-doc.py
#!/usr/bin/env python | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2016 The Bitcoin Core developers | # Copyright (c) 2015-2016 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. | ||||
Show All 40 Lines | |||||
SET_FALSE_POSITIVE_UNKNOWNS = set(['-nodebug', | SET_FALSE_POSITIVE_UNKNOWNS = set(['-nodebug', | ||||
'-zmqpubhashblock', | '-zmqpubhashblock', | ||||
'-zmqpubhashtx', | '-zmqpubhashtx', | ||||
'-zmqpubrawblock', | '-zmqpubrawblock', | ||||
'-zmqpubrawtx']) | '-zmqpubrawtx']) | ||||
def main(): | def main(): | ||||
used = check_output(CMD_GREP_ARGS_SRC, shell=True) | used = check_output(CMD_GREP_ARGS_SRC, shell=True).decode() | ||||
tested = check_output(CMD_GREP_ARGS_TEST, shell=True) | tested = check_output(CMD_GREP_ARGS_TEST, shell=True).decode() | ||||
docd = check_output(CMD_GREP_DOCS, shell=True) | docd = check_output(CMD_GREP_DOCS, shell=True).decode() | ||||
args_used = set(re.findall(REGEX_ARG, used)) | args_used = set(re.findall(REGEX_ARG, used)) | ||||
args_used -= set(re.findall(REGEX_ARG, tested)) | args_used -= set(re.findall(REGEX_ARG, tested)) | ||||
args_used |= SET_FALSE_POSITIVE_UNKNOWNS | args_used |= SET_FALSE_POSITIVE_UNKNOWNS | ||||
args_docd = set(re.findall(REGEX_DOC, docd)) | args_docd = set(re.findall(REGEX_DOC, docd)) | ||||
args_need_doc = args_used - args_docd - SET_DOC_OPTIONAL | args_need_doc = args_used - args_docd - SET_DOC_OPTIONAL | ||||
args_unknown = args_docd - args_used | args_unknown = args_docd - args_used | ||||
Show All 14 Lines |