Skip to content
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

Merged
merged 7 commits into from Sep 23, 2022

Commits on Sep 16, 2022

  1. Fix tests for E265 and E266 to be the right way around

    E265 is "block comment should start with '# '"
    E266 is "too many leading '#' for block comment"
    PeterJCLaw committed Sep 16, 2022
    Copy the full SHA
    7b3f0bb View commit details
    Browse the repository at this point in the history
  2. Rename E266 fixer to have the right name

    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.
    PeterJCLaw committed Sep 16, 2022
    Copy the full SHA
    1ad18df View commit details
    Browse the repository at this point in the history
  3. Implement a dedicated fixer for E265

    The E266 fixer will soon only fix E266, so E265 will need its own handling.
    PeterJCLaw committed Sep 16, 2022
    Copy the full SHA
    2fbeaaa View commit details
    Browse the repository at this point in the history
  4. Route testing of block comment fixes through the normal test utils

    This detatches this from the implementation function, clearing the
    way for changing the implementation.
    PeterJCLaw committed Sep 16, 2022
    Copy the full SHA
    7c10dd3 View commit details
    Browse the repository at this point in the history
  5. Convert the E266 fixer to be a more usual one

    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.
    PeterJCLaw committed Sep 16, 2022
    Copy the full SHA
    a029be9 View commit details
    Browse the repository at this point in the history
  6. Teach the E265 fixer to fix only 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.
    PeterJCLaw committed Sep 16, 2022
    Copy the full SHA
    7af08a3 View commit details
    Browse the repository at this point in the history
  7. Teach E265 fixer to ignore special comments even in the middle of files

    This appears to be expected for compatibility, though is a somewhat
    unexpected behaviour given that these comments are almost certainly
    not actually 'shebang' comments.
    PeterJCLaw committed Sep 16, 2022
    Copy the full SHA
    f4a40b1 View commit details
    Browse the repository at this point in the history