[pycodestyle] Implement blank-line-at-end-of-file (W391) - #10243
Conversation
pycodestyle] Implement blank-line-at-end-of-file (W391)
pycodestyle] Implement blank-line-at-end-of-file (W391)pycodestyle] Implement blank-line-at-end-of-file (W391)
CodSpeed Performance ReportMerging #10243 will not alter performanceComparing Summary
|
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| W391 | 27 | 27 | 0 | 0 | 0 |
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
MichaReiser
left a comment
There was a problem hiding this comment.
Thanks for your contribution.
We should convert this to a token based rule OR avoid using a regex to fix the performance regression.
| /// W391 | ||
| pub(crate) fn too_many_newlines_at_end_of_file( | ||
| diagnostics: &mut Vec<Diagnostic>, | ||
| lxr: &[LexResult], |
There was a problem hiding this comment.
I removed the Locator. I don't think we need to guard on empty files here -- that's just for the "no trailing newline" check, since empty files would be a false positive.
8794854 to
dbc0825
Compare
dbc0825 to
2d4e2fe
Compare
|
One more step towards #9057 🎉 |
Summary
Implements the blank line at end of file rule (W391) from pycodestyle. Renamed to TooManyNewlinesAtEndOfFile for clarity.
Test Plan
New fixtures have been added
Part of #2402