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

Don't split on pragma markers #4039

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Don't split on pragma markers #4039

wants to merge 3 commits into from

Conversation

zsol
Copy link
Collaborator

@zsol zsol commented Nov 10, 2023

Description

Pragma comments have similar semantics as # type: ignore, so they should be treated similarly: lines marked with them are fine to merge (this generally extends the scope of the suppression/pragma) but not OK to split.

Note: this changes the stable style; I'm not sure if that's OK in this case or not, but happy to rework this under a preview style flag if that's the only concern.

Checklist - did you ...

  • Add an entry in CHANGES.md if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

@zsol zsol force-pushed the pragma-comments branch 2 times, most recently from 65653e0 to e389390 Compare November 10, 2023 12:04
@zsol zsol marked this pull request as ready for review November 10, 2023 12:40
Copy link

diff-shades results comparing this PR (5456363) to main (58f31a7). The full diff is available in the logs under the "Generate HTML diff report" step.

╭──────────────────────── Summary ────────────────────────╮
│ 5 projects & 50 files changed / 471 changes [+116/-355] │
│                                                         │
│ ... out of 2 514 425 lines, 11 770 files & 23 projects  │
╰─────────────────────────────────────────────────────────╯

Differences found.

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

@amyreese
Copy link
Contributor

I would also like to see this with a configurable set of additional "pragma" comments. Eg, Fixit uses # lint-ignore: CODE and # lint-fixme: CODE that would be nice to be included in this feature, while # usort: skip or # isort: skip might also be useful.

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.

2 participants