[lint] require plugin flake8-comprehensions
Summary:
See https://pypi.org/project/flake8-comprehensions/ for a list of rules and examples.
To see the list of errors that this diff fixes, run the following commands (on master):
pip install flake8-comprehensions flake8 --select=C .
Note that in some cases it is required to convert a set/list/dict into a comprehensions (set(int(h, 16) for h in hashes) -> {int(h, 16) for h in hashes}) (error codes C400-404), and in some cases the opposite conversion makes more sense ({h for h in hashes} -> set(hashes)) (C416).
Depends on D13646
Test Plan:
arc lint --everything ninja check-functional-extended ninja bench-bitcoin ninja check contrib/devtools/circular-dependencies.py
I checked also that the most recent version of flake8-comprehensions and version 3.7.0 (most recent version still supporting python 3.6) are not incompatible, by running flake8 --select=C after installing flake8-comprehensions==3.7.0 after this diff and checking that no other error is raised.
I also checked that arc lint fails if the plugin is missing, with an error message that makes sense.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D13647