clojure-emacs / refactor-nrepl

nREPL middleware to support refactorings in an editor agnostic way
Eclipse Public License 1.0
256 stars 69 forks source link

Honor clj-kondo's namespace local configuration #388

Closed OknoLombarda closed 1 year ago

OknoLombarda commented 1 year ago

https://github.com/clojure-emacs/refactor-nrepl/issues/387

This PR makes refactor-nrepl honor clj-kondo's namespace-local configuration of :unused-namespace linter via config.edn file and also via ns meta when performing clean-ns task. I'll fix/add tests if code is fine

Thanks!

OknoLombarda commented 1 year ago

Well, looks like that's it. Unless you have any other comments, of course

OknoLombarda commented 1 year ago

All done. Also, I had to use double quote in tests because somehow with single quote it doesn't get the same form as when it's loaded by parse-ns. I don't understand why, to be honest https://github.com/OknoLombarda/refactor-nrepl/blob/kondo-ns-local-conf/test/refactor_nrepl/ns/libspec_allowlist_test.clj#L62

Also, I took this snippet from clj-kondo's code, so it should work (I guess such a small portion of code won't cause any licensing issues?)

https://github.com/clj-kondo/clj-kondo/blob/master/src/clj_kondo/impl/analyzer/namespace.clj#L475-L478

vemv commented 1 year ago

Thanks!

Also, I had to use double quote in tests

It's good. That happens simply because:

user=> (= '{1 1} {1 1})
true

I guess such a small portion of code won't cause any licensing issues?

Yes, it's really small

vemv commented 1 year ago

Thanks yet again!

Will be cutting a release this evening.

Cheers - V

vemv commented 1 year ago

I have released refactor-nrepl 3.6.0

clj-refactor.el 3.6.0 is been pushed and will be available in a couple hours!