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

Ability to skip formatting for specific sections of code #75

Open
ewels opened this issue Nov 25, 2024 · 0 comments
Open

Ability to skip formatting for specific sections of code #75

ewels opened this issue Nov 25, 2024 · 0 comments
Labels
formatting Related to automatic code formatting

Comments

@ewels
Copy link
Member

ewels commented Nov 25, 2024

Automatic code formatters are amazing, but sometimes you find edge cases where they get in the way. In these situations, it's nice to have a get-out-of-jail-free-I-know-what-I'm-doing-leave-me-alone option.

Other code formatters such as Black and Prettier have this option.

My suggestion would be to follow Black and have the following options:

  • // fmt: skip - don't format just this line
  • // fmt: off - turn formatting off from here onwards (can be used to skip an entire file)
  • // fmt: on - turn formatting back on again after a // fmt: off for a code block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatting Related to automatic code formatting
Projects
None yet
Development

No branches or pull requests

1 participant