Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWIP Do not flag whitespace only lines (includes tabs) in AvoidTrailingWhiteSpace rule #1048
Conversation
|
I'm not convinced that this addresses the issue. The heuristic should be checking previous lines for indentation and then making sure that the initial whitespace matches when the line has non non-space characters. The change as provided would allow a line which contains only whitespace, which could lead to a DOS attack. Imagine a file which contains immense amounts of whitespace on "empty" lines. |
|
I'm really not a fan of this change (see my comment below) |
|
@JamesWTruher Neither am I (see discussion in linked issue) and for issues inside editors, I agree that the editor settings to auto-delete extraneous whitespace on save are the way to go. But I can understand that it's frustrating for people who run
|
One other note: ignoring whitespace-only lines doesn't seem to be exactly what the issue ask was -- that issue implied a desire to check that the whitespace exists to the correct indentation level. That is something that is arguably much more involved to implement; the rule would need to do a stateful, indentation-aware pass over the script. It's the kind of thing we allow people to define their own rules for. Naturally though, only a rule about whitespace could generate this much discussion. |
bergmeister commentedJul 28, 2018
•
edited
PR Summary
Fixes #1033 by not flagging whitespace only lines (includes tabs) in AvoidTrailingWhiteSpace rule
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
xbetween the square brackets. Please mark anything not applicable to this PRNA.WIP:to the beginning of the title and remove the prefix when the PR is ready