As per #19346, mypy==0.700 was incompatible with Python 3.8.
I've bumped the versions of all the linters to their latest stable versions.
Checked with both Python 3.7 and 3.8 and everything still seems to work fine.
259 | @@ -260,11 +260,11 @@ Use the `-v` option for verbose output. 260 | 261 | | Lint test | Dependency | Version [used by CI](../ci/lint/04_install.sh) | Installation 262 | |-----------|:----------:|:-------------------------------------------:|-------------- 263 | -| [`lint-python.sh`](lint/lint-python.sh) | [flake8](https://gitlab.com/pycqa/flake8) | [3.7.8](https://github.com/bitcoin/bitcoin/pull/15257) | `pip3 install flake8==3.7.8` 264 | -| [`lint-python.sh`](lint/lint-python.sh) | [mypy](https://github.com/python/mypy) | [0.700](https://github.com/bitcoin/bitcoin/pull/18210) | `pip3 install mypy==0.700` 265 | -| [`lint-shell.sh`](lint/lint-shell.sh) | [ShellCheck](https://github.com/koalaman/shellcheck) | [0.6.0](https://github.com/bitcoin/bitcoin/pull/15166) | [details...](https://github.com/koalaman/shellcheck#installing) 266 | +| [`lint-python.sh`](lint/lint-python.sh) | [flake8](https://gitlab.com/pycqa/flake8) | [3.8.3](https://github.com/bitcoin/bitcoin/pull/15257) | `pip3 install flake8==3.8.3`
Will modify these URLs now to point to this PR (#19348).
Linting process working on Travis CI, but seems to show fail after test/lint/lint-python.sh with lint error E741 ambiguous variable name 'l'. Guess that's causing it to fail outright.
Linting process working on Travis CI, but seems to show fail after
test/lint/lint-python.shwith lint errorE741 ambiguous variable name 'l'. Guess that's causing it to fail outright.
You could remove this line: https://github.com/bitcoin/bitcoin/blob/8ef15e8a86038225afef2487ca23abc10ca5dffa/test/lint/lint-python.sh#L42 in this PR. And in a followup restore it with fixing all warnings.
From the ShellCheck v0.7.1 CHANGELOG:
- SC2230: 'command -v' suggestion is now off by default (-i deprecate-which)
To be coherent we should
--enable=deprecate-which to
https://github.com/bitcoin/bitcoin/blob/8ef15e8a86038225afef2487ca23abc10ca5dffa/test/lint/lint-shell.sh#L38OR
disabled_gitian list
https://github.com/bitcoin/bitcoin/blob/8ef15e8a86038225afef2487ca23abc10ca5dffa/test/lint/lint-shell.sh#L28Concept ACK.
Concept ACK
Nice first-time contribution @duncandean! Welcome as a contributor :)
Thanks, @practicalswift :)
I'll make the above-mentioned changes when I get a gap today. @hebasto, in terms of ShellCheck, I'm leaning towards accepting the new behaviour and removing the warnings.
38 | @@ -39,7 +39,6 @@ enabled=( 39 | E711 # comparison to None should be 'if cond is None:' 40 | E714 # test for object identity should be "is not" 41 | E721 # do not compare types, use "isinstance()" 42 | - E741 # do not use variables named "l", "O", or "I"
Going to add this back in a followup PR with fixes to offending code.
Perhaps it can be done in this PR?
I guess that would make it more atomic :)
There doesn't seem to be too much going on in this PR so I am happy to fix these here too if wanted. 👍
Renaming variables to comply to E741, imo, deserves its own PR. It would be nice if it will a scripted-diff.
After checking, the usage is also not so uniform throughout. l is in place of listener, line, etc and there are occurrences of it as a function parameter. Seems there might be other further discussion on that too.
rpc_createmultisig.py --descriptors failed. Not sure but looks like JSONRPC timeout.
rpc_createmultisig.py --descriptors failed. Not sure but looks like JSONRPC timeout.
Yes, this failure is unrelated to linter version changes.
6ea83891b025e69e382a89c5d144b5bd7f537ac6 LGTM
Mind squashing commits before the final review?
Updates Python linters, spellchecking, and ShellCheck versions. The PR links are updated for
the dependency versions in test/README.md. ShellCheck SC2230 removed to align with with new
behaviour in v0.7.1.
Fixes #19346.
ACK 39d526bde48d98af4fa27906e85db0399b6aa8b1, I have reviewed the code and it looks OK, I agree it can be merged.
Also verified ShellCheck downloading URL and changelog.