-
Notifications
You must be signed in to change notification settings - Fork 69
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 setting that allows keeping unused unaliased requires #386
Add setting that allows keeping unused unaliased requires #386
Conversation
I'll add tests and update readme if you have no comments regarding the code |
@@ -60,7 +61,9 @@ | |||
symbols-in-file) | |||
(some (partial libspec-in-use-without-refer-all? libspec) | |||
symbols-in-file)) | |||
(libspec-in-use-with-rename? libspec symbols-in-file)) | |||
(libspec-in-use-with-rename? libspec symbols-in-file) | |||
(and (not libspec-as) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example in clj-kondo linters file is (ns foo (:require [foo.specs]))
.
In other words, this will allow both foo.specs
and [foo.specs]
to remain, but isn't the wrapping what's used to signal that it's side-effecting in the clj-kondo convention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resolution of #359 (comment) is quite more recent than the one of the other issue. I'd like refactor-nrepl to contribute to a more explicit, standarized tooling landscape. The lack of an alias does't mean much in official Clojure terms. The extra semantic is a clj-kondo invention, that precedes its more explicit So I'd prefer that people write explicit .clj-kondo config. It's something that refactor-nrepl currently reads. It also is something that other tools (e.g. Eastwood) could also eventually read. It's a much better approach than reading magic comments ( |
Also, non trivially, one approach is naturally more prone to false positives than the other. If I add an entry to my .clj-kondo file, then my intent is certain. Contrariwise, adding For that reason alone, e.g. making our tools correct I think the right approach is clear now. It's not just aesthetics or 'standards'. Will be moving this PR to draft (with the intent of closing it if there isn't much opposition) |
Yeah, I just though that'd be convenient, but you're right, picking convenience in some situations over correctness is not worth it |
Any reason this could not be extended to actually using the clj-kondo file? Or is that already supported? |
It is already supported #361 |
Excellent 👍👍 |
Thank you both for the understanding! 🍻 |
Add setting that allows keeping unused unaliased requires, disabled by default
lein do clean, test
)./build.sh install
-- takes a long time)Thanks!