diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/debian/bitcoin-qt.desktop | 2 | ||||
-rw-r--r-- | contrib/devtools/README.md | 8 | ||||
-rwxr-xr-x | contrib/devtools/lint-includes.sh | 43 | ||||
-rwxr-xr-x | contrib/devtools/lint-logs.sh | 25 | ||||
-rwxr-xr-x | contrib/devtools/lint-tests.sh | 19 |
5 files changed, 94 insertions, 3 deletions
diff --git a/contrib/debian/bitcoin-qt.desktop b/contrib/debian/bitcoin-qt.desktop index 204cdf99d0..8b31222648 100644 --- a/contrib/debian/bitcoin-qt.desktop +++ b/contrib/debian/bitcoin-qt.desktop @@ -10,5 +10,5 @@ Terminal=false Type=Application Icon=bitcoin128 MimeType=x-scheme-handler/bitcoin; -Categories=Office;Finance; +Categories=Office;Finance;P2P;Network;Qt; StartupWMClass=Bitcoin-qt diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md index 8ca8fa9066..15ee8a3959 100644 --- a/contrib/devtools/README.md +++ b/contrib/devtools/README.md @@ -144,6 +144,14 @@ Configuring the github-merge tool for the bitcoin repository is done in the foll git config githubmerge.testcmd "make -j4 check" (adapt to whatever you want to use for testing) git config --global user.signingkey mykeyid (if you want to GPG sign) +Create and verify timestamps of merge commits +--------------------------------------------- +To create or verify timestamps on the merge commits, install the OpenTimestamps +client via `pip3 install opentimestamps-client`. Then, dowload the gpg wrapper +`ots-git-gpg-wrapper.sh` and set it as git's `gpg.program`. See +[the ots git integration documentation](https://github.com/opentimestamps/opentimestamps-client/blob/master/doc/git-integration.md#usage) +for further details. + optimize-pngs.py ================ diff --git a/contrib/devtools/lint-includes.sh b/contrib/devtools/lint-includes.sh new file mode 100755 index 0000000000..baca2f8a1f --- /dev/null +++ b/contrib/devtools/lint-includes.sh @@ -0,0 +1,43 @@ +#!/bin/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 for duplicate includes. + +filter_suffix() { + git ls-files | grep -E "^src/.*\.${1}"'$' | grep -Ev "/(leveldb|secp256k1|univalue)/" +} + +EXIT_CODE=0 +for HEADER_FILE in $(filter_suffix h); do + DUPLICATE_INCLUDES_IN_HEADER_FILE=$(grep -E "^#include " < "${HEADER_FILE}" | sort | uniq -d) + if [[ ${DUPLICATE_INCLUDES_IN_HEADER_FILE} != "" ]]; then + echo "Duplicate include(s) in ${HEADER_FILE}:" + echo "${DUPLICATE_INCLUDES_IN_HEADER_FILE}" + echo + EXIT_CODE=1 + fi + CPP_FILE=${HEADER_FILE/%\.h/.cpp} + if [[ ! -e $CPP_FILE ]]; then + continue + fi + DUPLICATE_INCLUDES_IN_HEADER_AND_CPP_FILES=$(grep -hE "^#include " <(sort -u < "${HEADER_FILE}") <(sort -u < "${CPP_FILE}") | grep -E "^#include " | sort | uniq -d) + if [[ ${DUPLICATE_INCLUDES_IN_HEADER_AND_CPP_FILES} != "" ]]; then + echo "Include(s) from ${HEADER_FILE} duplicated in ${CPP_FILE}:" + echo "${DUPLICATE_INCLUDES_IN_HEADER_AND_CPP_FILES}" + echo + EXIT_CODE=1 + fi +done +for CPP_FILE in $(filter_suffix cpp); do + DUPLICATE_INCLUDES_IN_CPP_FILE=$(grep -E "^#include " < "${CPP_FILE}" | sort | uniq -d) + if [[ ${DUPLICATE_INCLUDES_IN_CPP_FILE} != "" ]]; then + echo "Duplicate include(s) in ${CPP_FILE}:" + echo "${DUPLICATE_INCLUDES_IN_CPP_FILE}" + echo + EXIT_CODE=1 + fi +done +exit ${EXIT_CODE} diff --git a/contrib/devtools/lint-logs.sh b/contrib/devtools/lint-logs.sh new file mode 100755 index 0000000000..3bb54359a8 --- /dev/null +++ b/contrib/devtools/lint-logs.sh @@ -0,0 +1,25 @@ +#!/bin/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 logs are terminated with '\n' +# +# Some logs are continued over multiple lines. They should be explicitly +# commented with \* Continued *\ +# +# There are some instances of LogPrintf() in comments. Those can be +# ignored + + +UNTERMINATED_LOGS=$(git grep "LogPrintf(" -- "*.cpp" | \ + grep -v '\\n"' | \ + grep -v "/\* Continued \*/" | \ + grep -v "LogPrintf()") +if [[ ${UNTERMINATED_LOGS} != "" ]]; then + echo "All calls to LogPrintf() should be terminated with \\n" + echo + echo "${UNTERMINATED_LOGS}" + exit 1 +fi diff --git a/contrib/devtools/lint-tests.sh b/contrib/devtools/lint-tests.sh index dd1a3ebdc4..ffc0660551 100755 --- a/contrib/devtools/lint-tests.sh +++ b/contrib/devtools/lint-tests.sh @@ -4,7 +4,9 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # -# Check the test suite naming convention +# Check the test suite naming conventions + +EXIT_CODE=0 NAMING_INCONSISTENCIES=$(git grep -E '^BOOST_FIXTURE_TEST_SUITE\(' -- \ "src/test/**.cpp" "src/wallet/test/**.cpp" | \ @@ -15,5 +17,18 @@ if [[ ${NAMING_INCONSISTENCIES} != "" ]]; then echo "that convention:" echo echo "${NAMING_INCONSISTENCIES}" - exit 1 + EXIT_CODE=1 fi + +TEST_SUITE_NAME_COLLISSIONS=$(git grep -E '^BOOST_FIXTURE_TEST_SUITE\(' -- \ + "src/test/**.cpp" "src/wallet/test/**.cpp" | cut -f2 -d'(' | cut -f1 -d, | \ + sort | uniq -d) +if [[ ${TEST_SUITE_NAME_COLLISSIONS} != "" ]]; then + echo "Test suite names must be unique. The following test suite names" + echo "appear to be used more than once:" + echo + echo "${TEST_SUITE_NAME_COLLISSIONS}" + EXIT_CODE=1 +fi + +exit ${EXIT_CODE} |