-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix E265 and E266 confusion and overlap #650
Conversation
E265 is "block comment should start with '# '" E266 is "too many leading '#' for block comment"
It still ends up actually fixing E265 as well (it always did both) however that one is going to be easier to reproduce as a standard fixer.
The E266 fixer will soon only fix E266, so E265 will need its own handling.
This detatches this from the implementation function, clearing the way for changing the implementation.
adf1353
to
0a2c8e3
Compare
This still ends up fixing cases of E265 which overlap with E266 but doesn't go out of its way to do so if E265 is disabled. This ought to be fine since pycodestyle doesn't seem to ever complain about E266 on any lines affected by E265.
Previously it would end up changing E266 as well, which the user may not want it to do (for example if they've disabled E266). This also adds a battery of tests to excercise the differences between these errors.
This appears to be expected for compatibility, though is a somewhat unexpected behaviour given that these comments are almost certainly not actually 'shebang' comments.
09916f6
to
f4a40b1
Compare
Codecov ReportBase: 97.95% // Head: 97.91% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #650 +/- ##
==========================================
- Coverage 97.95% 97.91% -0.05%
==========================================
Files 1 1
Lines 2398 2399 +1
==========================================
Hits 2349 2349
- Misses 49 50 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for your contribution 👍
This rewrites the E265 and E266 fixers to be more like the majority of the other fixers that
autopep8
has (namely that they're now members of theFixPEP8
class). In doing so it separates how they work, making it possible for users to have neither, either or both fixers enabled.Reviewing by commit may be useful to understand the changes.
Fixes #649.
The codecov miss here is within
apply_global_fixes
which is doing less now that it really only exists forW602
.