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

Add suppression comment support #52

Open
DavisVaughan opened this issue Nov 22, 2024 · 2 comments · May be fixed by #223
Open

Add suppression comment support #52

DavisVaughan opened this issue Nov 22, 2024 · 2 comments · May be fixed by #223

Comments

@DavisVaughan
Copy link
Collaborator

No description provided.

@DavisVaughan
Copy link
Collaborator Author

From #185 :

ruff format supports # fmt: off, # fmt: on and # fmt: skip pragma comments to selectively disable the formatter. (https://docs.astral.sh/ruff/formatter/#format-suppression)

It'd be neat if air supported a similar system for selective disabling formatting, which might look like this:

# fmt: off
private$event_callback_counts[[domain]] <- private$event_callback_counts[[domain]] - 1
# fmt: on

private$event_callback_counts[[domain]] <- private$event_callback_counts[[domain]] + 1 # fmt: skip

@jayhesselberth
Copy link

This came up previously in styler: r-lib/styler#365

Running air on the pkgdown source, tribbles (with an "r") are another case where the intentional formatting is important for readability, and these are clobbered by air.

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 a pull request may close this issue.

2 participants