aboutsummaryrefslogtreecommitdiff
path: root/test/lint/check-doc.py
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2019-02-01 17:00:02 -0800
committerBen Woosley <ben.woosley@gmail.com>2019-09-03 14:38:38 -0400
commitb21680baf5391a602b295b9d7d0ef66553661cb9 (patch)
tree014dde0638aa584215f4855341606de65ed1fb89 /test/lint/check-doc.py
parent6e431296daceee604f48e9e3e87fa84cfd44bef2 (diff)
downloadbitcoin-b21680baf5391a602b295b9d7d0ef66553661cb9.tar.xz
test/contrib: Fix invalid escapes in regex strings
Flagged by flake8 v3.6.0, as W605, plus a few others identified incidentally, e.g. 59ffecf66cf4d08c4b431e457b083878d66a3fd6. Note that r"\n" matches to "\n" under re.match/search.
Diffstat (limited to 'test/lint/check-doc.py')
-rwxr-xr-xtest/lint/check-doc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lint/check-doc.py b/test/lint/check-doc.py
index 1d6122a13d..bd947d194c 100755
--- a/test/lint/check-doc.py
+++ b/test/lint/check-doc.py
@@ -15,8 +15,8 @@ import re
FOLDER_GREP = 'src'
FOLDER_TEST = 'src/test/'
-REGEX_ARG = '(?:ForceSet|SoftSet|Get|Is)(?:Bool)?Args?(?:Set)?\("(-[^"]+)"'
-REGEX_DOC = 'AddArg\("(-[^"=]+?)(?:=|")'
+REGEX_ARG = r'(?:ForceSet|SoftSet|Get|Is)(?:Bool)?Args?(?:Set)?\("(-[^"]+)"'
+REGEX_DOC = r'AddArg\("(-[^"=]+?)(?:=|")'
CMD_ROOT_DIR = '$(git rev-parse --show-toplevel)/{}'.format(FOLDER_GREP)
CMD_GREP_ARGS = r"git grep --perl-regexp '{}' -- {} ':(exclude){}'".format(REGEX_ARG, CMD_ROOT_DIR, FOLDER_TEST)
CMD_GREP_WALLET_ARGS = r"git grep --function-context 'void WalletInit::AddWalletOptions' -- {} | grep AddArg".format(CMD_ROOT_DIR)