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 option to exclude (comment) blocks from formatting #325

Open
raszi opened this issue Dec 2, 2023 · 3 comments
Open

Add option to exclude (comment) blocks from formatting #325

raszi opened this issue Dec 2, 2023 · 3 comments

Comments

@raszi
Copy link
Contributor

raszi commented Dec 2, 2023

Request

Implement a feature in cljfmt to exclude (comment) blocks from formatting. This is essential for those of us using these blocks for REPL-based development, as current formatting disrupts the workflow.

Suggested config

Allow specifying forms to exclude in the configuration, like:

:exclude [#"^comment"]

Impact

This addition would greatly aid developers who rely on specific formatting within (comment) blocks for efficient REPL interaction.

Thanks for your work on cljfmt!

@weavejester
Copy link
Owner

Thanks for the suggestion. I think I'd prefer a boolean :ignore-comment-forms? as an option instead for this, as it lends itself more easily to a command-line switch: --ignore-comment-forms.

@raszi
Copy link
Contributor Author

raszi commented Dec 12, 2023

That works, but that is less flexible, I thought there would be other use cases for this.

The other option could be to introduce an --ignore-comment-forms option that will set the exclude config to comment, and if you want to have more fine-grained control, then you could set the exclude manually.

Of course, then the CLI options would divert a bit from the config. The third option would be to add both. :)

@raszi
Copy link
Contributor Author

raszi commented Dec 12, 2023

But maybe I am overthinking and ignoring comments would be enough.

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