Skip to content

Allow # fmt: skip with interspersed same-line comments#9395

Merged
charliermarsh merged 1 commit intomainfrom
charlie/skip
Jan 5, 2024
Merged

Allow # fmt: skip with interspersed same-line comments#9395
charliermarsh merged 1 commit intomainfrom
charlie/skip

Conversation

@charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Jan 5, 2024

Summary

This is similar to #8876, but more limited in scope:

  1. It only applies to # fmt: skip (like Black). Like # isort: on, # fmt: on needs to be on its own line (still).
  2. It only delimits on #, so you can do # fmt: skip # noqa, but not # fmt: skip - some other content or # fmt: skip; noqa.

If we want to support the ;-delimited version, we should revisit later, since we don't support that in the linter (so # fmt: skip; noqa wouldn't register a noqa).

Closes #8892.

@charliermarsh charliermarsh marked this pull request as ready for review January 5, 2024 00:18
@charliermarsh charliermarsh added the formatter Related to the formatter label Jan 5, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2024

ruff-ecosystem results

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@charliermarsh charliermarsh merged commit 60ba7a7 into main Jan 5, 2024
@charliermarsh charliermarsh deleted the charlie/skip branch January 5, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

formatter Related to the formatter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatter: single_line_format_skip_with_multiple_comments preview style

2 participants