-
Notifications
You must be signed in to change notification settings - Fork 2
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
:use
is removed from ns declarations
#152
Comments
I have been waiting for someone to open an issue about this 😉 I have "support I am not sure of the best behavior for the formatter here. I consider the current behavior to be wrong / a bug. Two thoughts:
I think the second option is the better user experience, but I am not sure how challenging it will be to code up. The first option is not great, but better than the current behavior. This comment on Issue #142 is relevant. It may seem odd that a formatter recommends the user to "please refactor", but presumably if the user is using this tool then they desire the end state for their code to be something produced by the tool, and I do not have plans to add
Thank you 😁 🎉 |
Why not? There is a lot of code that uses |
My main reasoning is that |
It's not about preference, it's about supporting existing working code. (For example, Clojure core is filled with It's okay if Standard is only for the subset of Clojure you like, but I think that should be made more clear. |
Some thoughts: The current behavior is definitely a bug and needs to be fixed with either of the two options I outlined earlier. Option 1 is probably the easiest to code up right now, and Option 2 is a superior user experience. My understanding is that Standard JS is a good reference point here. |
I think deciding to not support formatting As an example, does standard also delete |
With PR-171, Standard Clojure Style will now throw an error recommending to refactor using |
I've been surprised by this behavior:
echo '(ns my.company.core (:use my-thing))' | standard-clj fix -
=> (ns my.company.core)
It removes the :use statement.
It seems a bit radical in my opinion, of course using
:use
is rarely justified but should it at least be replaced by a:refer :all
?A part from that I really enjoy this formatter for now, so thank you :)
The text was updated successfully, but these errors were encountered: