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.54k stars 291 forks source link

Try to fix an AttributeError related to pycodestyle 2.11.0 #699

Closed paugier closed 11 months ago

paugier commented 11 months ago

This could fix #689 (see also #1191).

Note that I have no idea of the consequence of this simple change... However, it would be interesting to check if the tests could succeed with pycodestyle 2.11.0.

codecov-commenter commented 11 months ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5b9110b) 97.83% compared to head (f961833) 97.83%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #699 +/- ## ======================================= Coverage 97.83% 97.83% ======================================= Files 1 1 Lines 2398 2402 +4 ======================================= + Hits 2346 2350 +4 Misses 52 52 ``` | [Files Changed](https://app.codecov.io/gh/hhatto/autopep8/pull/699?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://app.codecov.io/gh/hhatto/autopep8/pull/699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hideo+Hattori#diff-YXV0b3BlcDgucHk=) | `97.83% <100.00%> (+<0.01%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

shaperilio commented 11 months ago

@paugier thanks for this; currently flake8 6.1.0 claims it needs pycodestyle 2.11 so we're in a bind here. They combined white space checks into one and autopep8 has them separated.

A potential issue I see here is that you made a change in fix_e225 and fix_e231 is just below it. These are the two things that got merged on the pycodestyle side. So I would:

  1. Put a comment somewhere in there explaining why you had to make this change, and that these two checks got merged, and
  2. Check if fix_e225 also fixes E231, in which case we should probably clean this up a bit more.

(Trying to avoid a situation down the road where someone wonders e.g. why fix_e231 never gets called, etc.)

shaperilio commented 11 months ago

699, #696, #691, #690 are all the same. I suggest someone look into this comment and push their PR forward with a solution.

hhatto commented 11 months ago

thanks for contribution. This has been fixed in pull-request #696, so we will close this one 🙏 We will release a new version within a few days.