hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.
https://pypi.org/project/autopep8/
MIT License
4.56k stars 290 forks source link

Fix E265 and E266 confusion and overlap #650

Closed PeterJCLaw closed 1 year ago

PeterJCLaw commented 1 year ago

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 the FixPEP8 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 https://github.com/hhatto/autopep8/issues/649.

The codecov miss here is within apply_global_fixes which is doing less now that it really only exists for W602.

codecov-commenter commented 1 year ago

Codecov Report

Base: 97.95% // Head: 97.91% // Decreases project coverage by -0.04% :warning:

Coverage data is based on head (f4a40b1) compared to base (4884136). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ 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 ``` | [Impacted Files](https://codecov.io/gh/hhatto/autopep8/pull/650?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hideo+Hattori) | Coverage Δ | | |---|---|---| | [autopep8.py](https://codecov.io/gh/hhatto/autopep8/pull/650/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hideo+Hattori#diff-YXV0b3BlcDgucHk=) | `97.91% <100.00%> (-0.05%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hideo+Hattori). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hideo+Hattori)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.