Skip to content

Conversation

@Nikhil172913832
Copy link
Contributor

Description

Closes #4730

Black was ignoring # fmt: skip in deeply nested expressions (e.g., multi-part if-clauses). This change updates the tree climbing logic to correctly find the start of the line and all relevant siblings, ensuring that # fmt: skip works as intended even in complex nested cases.

Checklist - did you ...

  • Implement any code style changes under the --preview style, following the
    stability policy?
  • Add an entry in CHANGES.md if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

diff-shades reports zero changes comparing this PR (815b840) to main (1b342ef).


What is this? | Workflow run | diff-shades documentation

@cobaltt7
Copy link
Collaborator

cobaltt7 commented Dec 5, 2025

The diff-shades doesn't look right, it looks like some changes from multiline_string_handling have been reverted. Could you take a look at that? (click the "available in the logs") link

Also, as a heads up, we're going to be releasing 25.12.0 over the weekend, and we want to keep 26.1.0 limited to purely stablizing preview styles as much as possible, so this probably won't get merged until after those are released.

@Nikhil172913832
Copy link
Contributor Author

Nikhil172913832 commented Dec 6, 2025

Thanks for the review. I’ve made the required changes. Happy to wait for the right window after the upcoming releases.

@cobaltt7
Copy link
Collaborator

cobaltt7 commented Dec 7, 2025

Since this looks good and we haven't released yet, I'll go ahead and merge this now. Thanks!

@cobaltt7 cobaltt7 merged commit 5b470f0 into psf:main Dec 7, 2025
52 checks passed
cobaltt7 added a commit that referenced this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

# fmt: skip ignored inside multi-part if-clause

2 participants