-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Provide ability to customise cljfmt code formatting #2907
Comments
How come? Unless you trigger manually As mentioned in the chat solving this issue is not particularly complex. Seems we already added the ability to pass configuration to the middleware op responsible for invoking |
So I guess it is fighting against the (elisp) Indentation engine. The issue I have is that the indentation works differently depending on whether you are connected to the repl or not. I'd like to replace the current behaviour with something that is a bit more deterministic and it works the same whether the repl has evaluated a form or not. |
You can just disable dynamic (REPL-powered) indentation if you don't rely on it https://docs.cider.mx/cider/0.26/config/indentation.html Alternative you can completely override the indentation logic of |
Thanks for the link. I'll see if I can achieve what want with the configuration described there. However, I still think that this ticket stands. Having the possibility to configure the |
Yeah, I agree. |
**Describe the solution you'd like** It should be possible to provide a custom formatting configuration for cider-nrepl/cljfmt. The cljfmt configuration format is described here: https://github.com/weavejester/cljfmt#configuration The desired solution should have a defcustom variable where the configuration can be provided. **Describe alternatives you've considered** A workaround to this solution is to use an after-save-hook as described here: https://github.com/dzer6/cljfmt-graalvm However, in this case, the two formatters (cider, external cljfmt) will keep fighting each other causing an awful user experience. **Additional context** In clojure-emacs#2907 Bozhidar Batsov commented: > You can just disable dynamic (REPL-powered) indentation if you > don't rely on it > https://docs.cider.mx/cider/0.26/config/indentation.html > Alternative you can completely override the indentation logic of > clojure-mode and provide whatever implementation you want. CIDER > simply hooks into it and adds new indentation rules there > dynamically when connected. To which Brunno Bonacci responded: > However, I still think that this ticket stands. Having the > possibility to configure the cljfmt indentation rules is a > nice-to-have feature.
Describe the solution you'd like
It should be possible to provide a custom formatting configuration for cider-nrepl/cljfmt.
The cljfmt configuration format is described here:
https://github.com/weavejester/cljfmt#configuration
The desired solution should have a
defcustom
variable where the configuration can be provided.Describe alternatives you've considered
A workaround to this solution is to use an
after-save-hook
as described here:https://github.com/dzer6/cljfmt-graalvm
However, in this case, the two formatters (cider, external cljfmt) will keep fighting each other causing an awful user experience.
The text was updated successfully, but these errors were encountered: