Skip to content

Commit faebeb8

Browse files
author
MarcoFalke
committed
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
1 parent 7777047 commit faebeb8

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

test/lint/lint-python.py

-21
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,8 @@
3030

3131
ENABLED = (
3232
'E101,' # indentation contains mixed spaces and tabs
33-
'E112,' # expected an indented block
34-
'E113,' # unexpected indentation
35-
'E115,' # expected an indented block (comment)
36-
'E116,' # unexpected indentation (comment)
37-
'E125,' # continuation line with same indent as next logical line
38-
'E129,' # visually indented line with same indent as next logical line
39-
'E131,' # continuation line unaligned for hanging indent
40-
'E133,' # closing bracket is missing indentation
41-
'E223,' # tab before operator
42-
'E224,' # tab after operator
43-
'E242,' # tab after ','
44-
'E266,' # too many leading '#' for block comment
45-
'E271,' # multiple spaces after keyword
46-
'E272,' # multiple spaces before keyword
47-
'E273,' # tab after keyword
48-
'E274,' # tab before keyword
49-
'E275,' # missing whitespace after keyword
50-
'E304,' # blank lines found after function decorator
51-
'E306,' # expected 1 blank line before a nested definition
5233
'E401,' # multiple imports on one line
5334
'E402,' # module level import not at top of file
54-
'E502,' # the backslash is redundant between brackets
5535
'E701,' # multiple statements on one line (colon)
5636
'E702,' # multiple statements on one line (semicolon)
5737
'E703,' # statement ends with a semicolon
@@ -74,7 +54,6 @@
7454
'F631,' # assertion test is a tuple, which are always True
7555
'F632,' # use ==/!= to compare str, bytes, and int literals
7656
'F811,' # redefinition of unused name from line N
77-
'F812,' # list comprehension redefines 'foo' from line N
7857
'F821,' # undefined name 'Foo'
7958
'F822,' # undefined name name in __all__
8059
'F823,' # local variable name … referenced before assignment

0 commit comments

Comments
 (0)