aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2018-05-19 10:27:54 -0400
committerMarcoFalke <[email protected]>2018-05-24 12:02:15 -0400
commitfa3c910bfeab00703c947c5200a64c21225b50ef (patch)
tree6d8e8ad2d248c22fece1f5c1bebd6cf9ace38db0
parentMerge #13176: Improve CRollingBloomFilter performance: replace modulus with F... (diff)
downloaddiscoin-fa3c910bfeab00703c947c5200a64c21225b50ef.tar.xz
discoin-fa3c910bfeab00703c947c5200a64c21225b50ef.zip
test: Move linters to test/lint, add readme
-rw-r--r--.travis.yml18
-rw-r--r--contrib/devtools/README.md17
-rw-r--r--doc/developer-notes.md4
-rw-r--r--test/functional/README.md2
-rw-r--r--test/lint/README.md29
-rwxr-xr-xtest/lint/check-doc.py (renamed from contrib/devtools/check-doc.py)0
-rwxr-xr-xtest/lint/check-rpc-mappings.py (renamed from contrib/devtools/check-rpc-mappings.py)0
-rwxr-xr-xtest/lint/commit-script-check.sh (renamed from contrib/devtools/commit-script-check.sh)0
-rwxr-xr-xtest/lint/git-subtree-check.sh (renamed from contrib/devtools/git-subtree-check.sh)0
-rwxr-xr-xtest/lint/lint-all.sh (renamed from contrib/devtools/lint-all.sh)0
-rwxr-xr-xtest/lint/lint-include-guards.sh (renamed from contrib/devtools/lint-include-guards.sh)0
-rwxr-xr-xtest/lint/lint-includes.sh (renamed from contrib/devtools/lint-includes.sh)0
-rwxr-xr-xtest/lint/lint-logs.sh (renamed from contrib/devtools/lint-logs.sh)0
-rwxr-xr-xtest/lint/lint-python-shebang.sh (renamed from contrib/devtools/lint-python-shebang.sh)0
-rwxr-xr-xtest/lint/lint-python.sh (renamed from contrib/devtools/lint-python.sh)0
-rwxr-xr-xtest/lint/lint-shell.sh (renamed from contrib/devtools/lint-shell.sh)0
-rwxr-xr-xtest/lint/lint-tests.sh (renamed from contrib/devtools/lint-tests.sh)0
-rwxr-xr-xtest/lint/lint-whitespace.sh (renamed from contrib/devtools/lint-whitespace.sh)0
18 files changed, 42 insertions, 28 deletions
diff --git a/.travis.yml b/.travis.yml
index af5553f3b..a798c46bd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -85,17 +85,17 @@ jobs:
- python3-pip
- shellcheck
install:
- - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then travis_retry pip3 install flake8 --user; fi
+ - travis_retry pip3 install flake8 --user
before_script:
- git fetch --unshallow
- - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then contrib/devtools/commit-script-check.sh $TRAVIS_COMMIT_RANGE; fi
- - contrib/devtools/git-subtree-check.sh src/crypto/ctaes
- - contrib/devtools/git-subtree-check.sh src/secp256k1
- - contrib/devtools/git-subtree-check.sh src/univalue
- - contrib/devtools/git-subtree-check.sh src/leveldb
- - contrib/devtools/check-doc.py
- - contrib/devtools/check-rpc-mappings.py .
- - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then contrib/devtools/lint-all.sh; fi
+ - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then test/lint/commit-script-check.sh $TRAVIS_COMMIT_RANGE; fi
+ - test/lint/git-subtree-check.sh src/crypto/ctaes
+ - test/lint/git-subtree-check.sh src/secp256k1
+ - test/lint/git-subtree-check.sh src/univalue
+ - test/lint/git-subtree-check.sh src/leveldb
+ - test/lint/check-doc.py
+ - test/lint/check-rpc-mappings.py .
+ - test/lint/lint-all.sh
script:
- if [ "$TRAVIS_REPO_SLUG" = "bitcoin/bitcoin" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then while read LINE; do travis_retry gpg --keyserver hkp://subset.pool.sks-keyservers.net --recv-keys $LINE; done < contrib/verify-commits/trusted-keys; fi
- if [ "$TRAVIS_REPO_SLUG" = "bitcoin/bitcoin" -a "$TRAVIS_EVENT_TYPE" = "cron" ]; then travis_wait 30 contrib/verify-commits/verify-commits.sh; fi
diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md
index 15ee8a395..53563fe58 100644
--- a/contrib/devtools/README.md
+++ b/contrib/devtools/README.md
@@ -93,23 +93,6 @@ example:
BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh
```
-git-subtree-check.sh
-====================
-
-Run this script from the root of the repository to verify that a subtree matches the contents of
-the commit it claims to have been updated to.
-
-To use, make sure that you have fetched the upstream repository branch in which the subtree is
-maintained:
-* for `src/secp256k1`: https://github.com/bitcoin-core/secp256k1.git (branch master)
-* for `src/leveldb`: https://github.com/bitcoin-core/leveldb.git (branch bitcoin-fork)
-* for `src/univalue`: https://github.com/bitcoin-core/univalue.git (branch master)
-* for `src/crypto/ctaes`: https://github.com/bitcoin-core/ctaes.git (branch master)
-
-Usage: `git-subtree-check.sh DIR (COMMIT)`
-
-`COMMIT` may be omitted, in which case `HEAD` is used.
-
github-merge.py
===============
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index 1f237b750..9081cab91 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -647,7 +647,7 @@ Others are external projects without a tight relationship with our project. Cha
be sent upstream but bugfixes may also be prudent to PR against Bitcoin Core so that they can be integrated
quickly. Cosmetic changes should be purely taken upstream.
-There is a tool in contrib/devtools/git-subtree-check.sh to check a subtree directory for consistency with
+There is a tool in `test/lint/git-subtree-check.sh` to check a subtree directory for consistency with
its upstream repository.
Current subtrees include:
@@ -778,7 +778,7 @@ To create a scripted-diff:
- `-BEGIN VERIFY SCRIPT-`
- `-END VERIFY SCRIPT-`
-The scripted-diff is verified by the tool `contrib/devtools/commit-script-check.sh`
+The scripted-diff is verified by the tool `test/lint/commit-script-check.sh`
Commit [`bb81e173`](https://github.com/bitcoin/bitcoin/commit/bb81e173) is an example of a scripted-diff.
diff --git a/test/functional/README.md b/test/functional/README.md
index 21050cc2f..fdd7c339c 100644
--- a/test/functional/README.md
+++ b/test/functional/README.md
@@ -20,6 +20,8 @@ don't have test cases for.
- Where possible, try to adhere to [PEP-8 guidelines](https://www.python.org/dev/peps/pep-0008/)
- Use a python linter like flake8 before submitting PRs to catch common style
nits (eg trailing whitespace, unused imports, etc)
+- See [the python lint script](/test/lint/lint-python.sh) that checks for violations that
+ could lead to bugs and issues in the test code.
- Avoid wildcard imports where possible
- Use a module-level docstring to describe what the test is testing, and how it
is testing it.
diff --git a/test/lint/README.md b/test/lint/README.md
new file mode 100644
index 000000000..15974a359
--- /dev/null
+++ b/test/lint/README.md
@@ -0,0 +1,29 @@
+This folder contains lint scripts.
+
+check-doc.py
+============
+Check for missing documentation of command line options.
+
+commit-script-check.sh
+======================
+Verification of [scripted diffs](/doc/developer-notes.md#scripted-diffs).
+
+git-subtree-check.sh
+====================
+Run this script from the root of the repository to verify that a subtree matches the contents of
+the commit it claims to have been updated to.
+
+To use, make sure that you have fetched the upstream repository branch in which the subtree is
+maintained:
+* for `src/secp256k1`: https://github.com/bitcoin-core/secp256k1.git (branch master)
+* for `src/leveldb`: https://github.com/bitcoin-core/leveldb.git (branch bitcoin-fork)
+* for `src/univalue`: https://github.com/bitcoin-core/univalue.git (branch master)
+* for `src/crypto/ctaes`: https://github.com/bitcoin-core/ctaes.git (branch master)
+
+Usage: `git-subtree-check.sh DIR (COMMIT)`
+
+`COMMIT` may be omitted, in which case `HEAD` is used.
+
+lint-all.sh
+===========
+Calls other scripts with the `lint-` prefix.
diff --git a/contrib/devtools/check-doc.py b/test/lint/check-doc.py
index de5719eb2..de5719eb2 100755
--- a/contrib/devtools/check-doc.py
+++ b/test/lint/check-doc.py
diff --git a/contrib/devtools/check-rpc-mappings.py b/test/lint/check-rpc-mappings.py
index 7e96852c5..7e96852c5 100755
--- a/contrib/devtools/check-rpc-mappings.py
+++ b/test/lint/check-rpc-mappings.py
diff --git a/contrib/devtools/commit-script-check.sh b/test/lint/commit-script-check.sh
index 1c9dbc7f6..1c9dbc7f6 100755
--- a/contrib/devtools/commit-script-check.sh
+++ b/test/lint/commit-script-check.sh
diff --git a/contrib/devtools/git-subtree-check.sh b/test/lint/git-subtree-check.sh
index 184951715..184951715 100755
--- a/contrib/devtools/git-subtree-check.sh
+++ b/test/lint/git-subtree-check.sh
diff --git a/contrib/devtools/lint-all.sh b/test/lint/lint-all.sh
index b6d86959c..b6d86959c 100755
--- a/contrib/devtools/lint-all.sh
+++ b/test/lint/lint-all.sh
diff --git a/contrib/devtools/lint-include-guards.sh b/test/lint/lint-include-guards.sh
index 6a0dd556b..6a0dd556b 100755
--- a/contrib/devtools/lint-include-guards.sh
+++ b/test/lint/lint-include-guards.sh
diff --git a/contrib/devtools/lint-includes.sh b/test/lint/lint-includes.sh
index f54be46b5..f54be46b5 100755
--- a/contrib/devtools/lint-includes.sh
+++ b/test/lint/lint-includes.sh
diff --git a/contrib/devtools/lint-logs.sh b/test/lint/lint-logs.sh
index 35be13ec1..35be13ec1 100755
--- a/contrib/devtools/lint-logs.sh
+++ b/test/lint/lint-logs.sh
diff --git a/contrib/devtools/lint-python-shebang.sh b/test/lint/lint-python-shebang.sh
index f5c5971c0..f5c5971c0 100755
--- a/contrib/devtools/lint-python-shebang.sh
+++ b/test/lint/lint-python-shebang.sh
diff --git a/contrib/devtools/lint-python.sh b/test/lint/lint-python.sh
index 7d3555b6d..7d3555b6d 100755
--- a/contrib/devtools/lint-python.sh
+++ b/test/lint/lint-python.sh
diff --git a/contrib/devtools/lint-shell.sh b/test/lint/lint-shell.sh
index 5f5fa9a92..5f5fa9a92 100755
--- a/contrib/devtools/lint-shell.sh
+++ b/test/lint/lint-shell.sh
diff --git a/contrib/devtools/lint-tests.sh b/test/lint/lint-tests.sh
index ffc066055..ffc066055 100755
--- a/contrib/devtools/lint-tests.sh
+++ b/test/lint/lint-tests.sh
diff --git a/contrib/devtools/lint-whitespace.sh b/test/lint/lint-whitespace.sh
index c5d43043d..c5d43043d 100755
--- a/contrib/devtools/lint-whitespace.sh
+++ b/test/lint/lint-whitespace.sh