aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-11-23 08:35:36 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-11-23 09:42:33 +0100
commita0d86815cda982d06db333fd9290aa82660807cb (patch)
tree1046bf15a8216e3ab0ceb3288933976740319e85 /test
parentd7fbe7d927eae37056a751af681507c06c774f2f (diff)
parentfa5e0452e875a7ca6bf6fe61fdd652d341eece40 (diff)
downloadbitcoin-a0d86815cda982d06db333fd9290aa82660807cb.tar.xz
Merge #14726: Use RPCHelpMan for all RPCs
fa5e0452e875a7ca6bf6fe61fdd652d341eece40 rpc: Documentation fixups (MarcoFalke) fa91e8eda541acdb78ca481b74605639f319c108 Use RPCHelpMan for all RPCs (MarcoFalke) fa520e72f7b5964cea1ade666e71212914556cf3 lint: Must use RPCHelpMan to generate the RPC docs (MarcoFalke) Pull request description: The resulting documentation should not change unless the type in the oneline-summary was previously incorrect. (E.g. string vs bool) Tree-SHA512: 4ff355b6a53178f02781e97a7aca7ee1d0d97ff348b6bf5a01caa1c96904ee33c704465fae54c2cd7445097427fd04c71ad3779bb7a7ed886055ef36c1b5a1d0
Diffstat (limited to 'test')
-rwxr-xr-xtest/lint/lint-rpc-help.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lint/lint-rpc-help.sh b/test/lint/lint-rpc-help.sh
new file mode 100755
index 0000000000..faac5d43e2
--- /dev/null
+++ b/test/lint/lint-rpc-help.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2018 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#
+# Check that all RPC help texts are generated by RPCHelpMan.
+
+export LC_ALL=C
+
+EXIT_CODE=0
+
+# Assume that all multiline strings passed into a runtime_error are help texts.
+# This is potentially fragile, but the linter is only temporary and can safely
+# be removed early 2019.
+
+non_autogenerated_help=$(grep --perl-regexp --null-data --only-matching 'runtime_error\(\n\s*".*\\n"\n' $(git ls-files -- "*.cpp"))
+if [[ ${non_autogenerated_help} != "" ]]; then
+ echo "Must use RPCHelpMan to generate the help for the following RPC methods:"
+ echo "${non_autogenerated_help}"
+ echo
+ EXIT_CODE=1
+fi
+exit ${EXIT_CODE}