dash/test/lint
Wladimir J. van der Laan 1995d2e7ca
Merge #20451: lint: run mypy over contrib/devtools
1ef2138c0db3bd4f9332c777fa3fb2770dc1b08c lint: run mypy over contrib/devtools (fanquake)

Pull request description:

  wumpus mentioned on IRC that we don't currently run `mypy` over the `contrib/devtools` directory, and that it would likely be worthwhile given #20434. This just adds that dir to the linter, as well as some missing annotations to fix existing errors. Note that now we require Python 3.6 we can make use of variable annotations.

  master (patched to check contrib devtools):
  ```bash
  test/lint/lint-python.sh
  contrib/devtools/symbol-check.py:154: error: Incompatible types in assignment (expression has type "List[str]", variable has type "str")
  contrib/devtools/circular-dependencies.py:35: error: Need type annotation for 'deps' (hint: "deps: Dict[<type>, <type>] = ...")
  contrib/devtools/circular-dependencies.py:67: error: Need type annotation for 'closure' (hint: "closure: Dict[<type>, <type>] = ...")
  Found 4 errors in 3 files (checked 187 source files)
  ```

  I haven't quite gone as far as to add annotations like
  ```python
  CHECKS: Dict[str, List[Tuple[str, Callable[[Any], bool]]]] = {...
  ```
  to `symbol-check.py`.

ACKs for top commit:
  laanwj:
    ACK 1ef2138c0db3bd4f9332c777fa3fb2770dc1b08c

Tree-SHA512: a58c2ece588c640289dc1d35dad5b1b8732788272daa0965d6bf44ee8a7f7c8e8585f94d233ac41c84b9ffcfc97841a00fe2c9acba41f58fd164f01de4b6512b
2024-04-03 14:16:43 +07:00
..
check-doc.py
check-rpc-mappings.py Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
commit-script-check.sh Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
extended-lint-all.sh Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
extended-lint-cppcheck.sh chore: dashification of descriptor implementation in dash 2024-03-07 01:22:37 +07:00
git-subtree-check.sh Merge #20567: test: Add option to git-subtree-check to do full check, add help 2023-12-06 11:40:14 -06:00
lint-all.sh
lint-assertions.sh Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
lint-circular-dependencies.sh Merge bitcoin/bitcoin#22736: log, sync: change lock contention from preprocessor directive to log category 2024-04-02 12:09:35 -05:00
lint-cppcheck-dash.sh fix: adjust wallet/bip39 accordingly linter comments 2024-03-24 00:41:23 +07:00
lint-filenames.sh Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
lint-format-strings.py Merge #16688: log: Add validation interface logging 2023-05-24 12:43:57 -05:00
lint-format-strings.sh Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
lint-git-commit-check.sh Merge #20071: ci, lint: Remove usage of TRAVIS_COMMIT_RANGE 2024-01-27 22:44:49 -06:00
lint-include-guards.sh feat: new util class expected for return errors by more convenient way 2024-01-10 15:12:05 -06:00
lint-includes.sh mempool: remove stray boost::optional usage 2024-03-25 11:55:06 +00:00
lint-locale-dependence.sh Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
lint-logs.sh Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
lint-python-dead-code.sh
lint-python-mutable-default-parameters.py Merge bitcoin/bitcoin#24800: lint: convert lint-python-mutable-default-parameters.sh to Python 2024-01-02 11:17:47 -06:00
lint-python-utf8-encoding.sh partial bitcoin#27445: Update src/secp256k1 subtree to release v0.3.1 2023-11-21 07:59:03 -06:00
lint-python.sh Merge #20451: lint: run mypy over contrib/devtools 2024-04-03 14:16:43 +07:00
lint-rpc-help.sh
lint-shebang.sh Merge #18673: scripted-diff: Sort test includes 2023-08-29 22:00:59 -05:00
lint-shell-locale.sh build/depends: commit dashpay/bls-signatures@66ee820f to source tree as vendored (#5077) 2022-11-22 11:34:46 -06:00
lint-shell.sh Merge #20697: ci: Fix COMMIT_RANGE variable value for PRs 2024-03-27 00:48:27 +07:00
lint-spelling.ignore-words.txt Merge #20817: lint: update list of spelling linter false positives, bump to codespell 2.0.0 2024-03-27 00:48:28 +07:00
lint-spelling.sh Merge #20817: lint: update list of spelling linter false positives, bump to codespell 2.0.0 2024-03-27 00:48:28 +07:00
lint-submodule.py Merge bitcoin/bitcoin#24803: lint: convert submodule linter test to Python 2024-01-13 19:32:31 -06:00
lint-tests.py Merge bitcoin/bitcoin#24815: lint: convert lint-tests.sh to python 2024-01-13 19:32:31 -06:00
lint-whitespace.sh Merge #20071: ci, lint: Remove usage of TRAVIS_COMMIT_RANGE 2024-01-27 22:44:49 -06:00
README.md Merge #20567: test: Add option to git-subtree-check to do full check, add help 2023-12-06 11:40:14 -06:00

This folder contains lint scripts.

check-doc.py

Check for missing documentation of command line options.

commit-script-check.sh

Verification of scripted diffs. Scripted diffs are only assumed to run on the latest LTS release of Ubuntu. Running them on other operating systems might require installing GNU tools, such as GNU sed.

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.

Usage: test/lint/git-subtree-check.sh [-r] DIR [COMMIT]
       test/lint/git-subtree-check.sh -?
  • DIR is the prefix within the repository to check.
  • COMMIT is the commit to check, if it is not provided, HEAD will be used.
  • -r checks that subtree commit is present in repository.

To do a full check with -r, make sure that you have fetched the upstream repository branch in which the subtree is maintained:

To do so, add the upstream repository as remote:

git remote add --fetch secp256k1 https://github.com/bitcoin-core/secp256k1.git

lint-all.sh

Calls other scripts with the lint- prefix.