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

[563] Fix standalone comments inside complex blocks crashing Black #4016

Merged
merged 9 commits into from Nov 7, 2023

Commits on Nov 1, 2023

  1. Test cases

    henriholopainen committed Nov 1, 2023
    Copy the full SHA
    c046388 View commit details
    Browse the repository at this point in the history
  2. Fix standalone comment processing

    Bracket depth is not an accurate indicator of standalone comment position inside more complex blocks because bracket depth can be virtual (in loops' and lambdas' parameter blocks) or from optional parens. Here we try to stop cumulating lines upon standalone comments in complex blocks, and try to make standalone comment processing more simple. The fundamental idea is, that if we have a standalone comment, it needs to go on its own line, so we always have to split.
    
    This is not perfect, but at least a first step.
    henriholopainen committed Nov 1, 2023
    Copy the full SHA
    bd3754c View commit details
    Browse the repository at this point in the history
  3. Add changelog line

    henriholopainen committed Nov 1, 2023
    Copy the full SHA
    e42e19d View commit details
    Browse the repository at this point in the history
  4. Update PR number

    henriholopainen committed Nov 1, 2023
    Copy the full SHA
    4e4cbbc View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2023

  1. Add test case

    henriholopainen committed Nov 2, 2023
    Copy the full SHA
    624cf9f View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    a86c13a View commit details
    Browse the repository at this point in the history
  3. Combine ifs

    henriholopainen committed Nov 2, 2023
    Copy the full SHA
    20fd2d2 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2023

  1. Copy the full SHA
    4dc7170 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    3b1d969 View commit details
    Browse the repository at this point in the history