I’m going through the ignore errors on flake8, and noticed that there are some that I don’t quite understand why we are choosing to ignore.
-
Continuation line under-indented for hanging indent (E121)
- There’s only a single JSON in the codebase that doesn’t comply with this already.
-
Closing bracket does not match indentation of opening bracket’s line (E123)
- This one could go either way via PEP, but it may be worth just enforcing a standard forconsistency. The vast vast majority of our code already conforms to the “best practice”.
-
Continuation line over-indented for hanging indent (E126)
- Similar to E121, there’s only a handful of lines that don’t follow this already and is just enforcing 4 space indentation levels.
-
Multiple spaces before operator (E221)
- This one seems like a no brainer to implement. Our current reasoning is for “horizontal alignment” but there is only one line of code in the entire codebase that takes advantage of it.
- Relevant PR
-
Missing whitespace around arithmetic operator (E226)
- Good news, there isn’t a single line of code that doesn’t already conform to this. Might as well make it official.
- Relevant PR
-
Tab after ‘,’ (E242)
- Again, nothing in our codebase goes against this so might as well make it official.
- Relevant PR
-
Expected 2 blank lines after end of function or class (E305)
- This seems like standard spacing (and per PEP)
-
Multiple statements on one line (def) (E704)
- Another one where we don’t have any current errors for this one. Seems reasonable to create a standard for it.
- Relevant PR
-
Do not use variables named ‘I’, ‘O’, or ‘l’ (E741)
- There’s about ~20 lines of code that don’t conform to this. Wouldn’t be too hard to fix those and enforce this one.
-
Line break occurred after a binary operator (W504)
- This one used to used to be the other way around, but it seems PEP has taken an official stance and prefers this rule. Makes sense to make a standard in our codebase. (would require changing ~40 lines of code)
Thoughts? Objections? If these are seen as reasonable changes, I’ll make a PR implementing them.