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

Support disabling formatting on forms #78

Open
arrdem opened this issue Jul 27, 2016 · 1 comment
Open

Support disabling formatting on forms #78

arrdem opened this issue Jul 27, 2016 · 1 comment

Comments

@arrdem
Copy link
Contributor

arrdem commented Jul 27, 2016

Most formatting tools provide a way to disable formatting on some expression. For instance various Java and Python tools allow comments at end of line such as # nofmt or # lint: ignore in which case no changes will be made to those lines.

That particular implementation doesn't map well to Clojure, since it's a form oriented language but one could certainly imagine situations where a user really truly thinks they know better than the formatter and wants to disable it for small blocks of code.

I propose that selecting (either by form metadata or a leading/trailing comment) a form to ignore would be the best implementation of this, since it provides the behavior we want (local opt-out) while making it difficult to just tell the linter to go away altogether. The default after all should be code which conforms to the style guide / linter output.

@camsaul
Copy link
Contributor

camsaul commented Apr 19, 2023

A clj-kondo style comment form like

#_:cljfmt/ignore
(some-form ...)

would probably be the way to go in 2023.

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

No branches or pull requests

2 participants