mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 01:42:58 +01:00
lint: Remove python whitespace and shadowing lint rules
The rules have many issues: * Most are redundant, because Python already has a built-in IndentationError, a subclass of SyntaxError, to enforce whitespace. * They are not enforced consistently anyway, see for examples [1][2] below. * They are stylistic rules where the author intentionally formatted the code to be easier to read. Starting to enforce them now would make the code harder to read and create frustration in the future. Fix all issues by removing them. [1]: test/functional/feature_cltv.py:63:35: E272 [*] Multiple spaces before keyword | 61 | # | Script to prepend to scriptSig | nSequence | nLockTime | 62 | # +-------------------------------------------------+------------+--------------+ 63 | [[OP_CHECKLOCKTIMEVERIFY], None, None], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E272 [2]: contrib/asmap/asmap.py:395:13: E306 [*] Expected 1 blank line before a nested definition, found 0 | 393 | prefix.pop() 394 | hole = not fill and (lhole or rhole) 395 | def candidate(ctx: Optional[int], res0: Optional[list[ASNEntry]], | ^^^ E306
This commit is contained in:
parent
7777047835
commit
faebeb828f
@ -30,28 +30,8 @@ MYPY_FILES_ARGS = ['git', 'ls-files', 'test/functional/*.py', 'contrib/devtools/
|
||||
|
||||
ENABLED = (
|
||||
'E101,' # indentation contains mixed spaces and tabs
|
||||
'E112,' # expected an indented block
|
||||
'E113,' # unexpected indentation
|
||||
'E115,' # expected an indented block (comment)
|
||||
'E116,' # unexpected indentation (comment)
|
||||
'E125,' # continuation line with same indent as next logical line
|
||||
'E129,' # visually indented line with same indent as next logical line
|
||||
'E131,' # continuation line unaligned for hanging indent
|
||||
'E133,' # closing bracket is missing indentation
|
||||
'E223,' # tab before operator
|
||||
'E224,' # tab after operator
|
||||
'E242,' # tab after ','
|
||||
'E266,' # too many leading '#' for block comment
|
||||
'E271,' # multiple spaces after keyword
|
||||
'E272,' # multiple spaces before keyword
|
||||
'E273,' # tab after keyword
|
||||
'E274,' # tab before keyword
|
||||
'E275,' # missing whitespace after keyword
|
||||
'E304,' # blank lines found after function decorator
|
||||
'E306,' # expected 1 blank line before a nested definition
|
||||
'E401,' # multiple imports on one line
|
||||
'E402,' # module level import not at top of file
|
||||
'E502,' # the backslash is redundant between brackets
|
||||
'E701,' # multiple statements on one line (colon)
|
||||
'E702,' # multiple statements on one line (semicolon)
|
||||
'E703,' # statement ends with a semicolon
|
||||
@ -74,7 +54,6 @@ ENABLED = (
|
||||
'F631,' # assertion test is a tuple, which are always True
|
||||
'F632,' # use ==/!= to compare str, bytes, and int literals
|
||||
'F811,' # redefinition of unused name from line N
|
||||
'F812,' # list comprehension redefines 'foo' from line N
|
||||
'F821,' # undefined name 'Foo'
|
||||
'F822,' # undefined name name in __all__
|
||||
'F823,' # local variable name … referenced before assignment
|
||||
|
Loading…
Reference in New Issue
Block a user