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

introduce # fmt: off and # fmt: on tags to skip formatting within files #86

Open
dlaehnemann opened this issue Dec 1, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@dlaehnemann
Copy link

This is a follow-up feature request to issue #85 that deals with comment formatting. Handling of one of the test cases there, with aligned comments across multiple lines to hide these lines during docs rendering, cannot be implemented easily within snakefmt.

As suggested in that issue's discussion, one workaround could be comment tags before and after respective sections that turn formatting off and then back on.

black has this and uses # fmt: off and #fmt: on, requiring both comments to be on the same indentation level. I think it would make sense to use exactly the same syntax, so that black users will already know it. And the naming makes perfect sense for snakefmt, as well.
In black, you should find the relevant code by searching for FMT_OFF in:
https://github.com/psf/black/blob/dea81b7ad5cfa04c3572771c34af823449d0a8f3/src/black/__init__.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants