clojure-australia

Hugh Powell 2021-07-20T00:07:27.092Z

Morning folks 👋 . How are peoples days looking? Bug triage and fixing for me.

Oliver George 2021-07-20T00:15:13.092200Z

Morning all.

Oliver George 2021-07-20T00:16:04.093Z

I've just done clojure-lsp clean-ns for the first time and it feels sooo good.

Hugh Powell 2021-07-20T00:20:58.093900Z

That's cool. I hadn't looked at clojure-lsp because I assumed it was just for IDE developers. Down the rabbit hole we go ...

Oliver George 2021-07-20T00:24:28.094400Z

Here's my TLDR

xlfe 2021-07-20T00:24:45.094700Z

dependabot updates for me. finishing off feature branches before starting anotherone 😄

Oliver George 2021-07-20T00:25:12.095100Z

I added this to my deps.edn

:aliases
  {:lint-ns {:replace-deps {com.github.clojure-lsp/clojure-lsp {:mvn/version "2021.07.19-14.46.52"}}
             :exec-fn clojure-lsp.api/clean-ns!
             :exec-args {:dry? false}}}}

Oliver George 2021-07-20T00:25:26.095400Z

Then ran clojure -X:lint-ns

Oliver George 2021-07-20T00:25:51.096Z

(as an aside, my project has dated deps and :replace-deps was needed to deal with a tasso logging version conflict which crashed things)

xlfe 2021-07-20T00:26:08.096400Z

hmm. would that be an alternative to clj-kondo linting?

Oliver George 2021-07-20T00:26:29.096800Z

similar / overlapping

xlfe 2021-07-20T00:26:48.097400Z

ah 👍

Oliver George 2021-07-20T00:26:49.097500Z

I suspect it's a superset / overlap of carve

Oliver George 2021-07-20T00:27:05.098Z

(The verbose logging refers to using clj-kondo from memory)

xlfe 2021-07-20T00:28:14.098600Z

right. I tried carve and was overwhelmed. started trying to use https://gist.github.com/borkdude/841d85d5ad04c517337166b3928697bd and ran into https://github.com/clj-kondo/clj-kondo/issues/1319

Oliver George 2021-07-20T00:28:48.099100Z

I've found carve useful and reliable.

xlfe 2021-07-20T00:29:08.099900Z

yeah I just had so much unused code! the linked gist is a single symbol search for all usages

xlfe 2021-07-20T00:29:24.100400Z

eg i was hoping i could integrate it into my IDE so that for a specific symbol I could find all usages

xlfe 2021-07-20T00:29:28.100600Z

ie cleanup things one by one

Oliver George 2021-07-20T00:29:38.100800Z

Ah, gotcha

xlfe 2021-07-20T00:29:59.101300Z

I mean I suppose I could scope carve to a specific ns or symbol even

Oliver George 2021-07-20T00:30:12.101700Z

I'm new to clojure-lsp but the brew installable command line tools include these:

Oliver George 2021-07-20T00:30:13.101900Z

clean-ns Organize ns form, removing unused requires/refers/imports and sorting alphabetically. format Format code using cljfmt. rename Rename a symbol and all references across the project, use --from and --to options.

xlfe 2021-07-20T00:31:25.102600Z

ah right - the clean-ns does sound useful

xlfe 2021-07-20T00:33:13.103600Z

for comparison - clj-kondo integrated into vim for unusued imports warnings, etc

Oliver George 2021-07-20T00:49:01.104500Z

Nice. The intellij integration works well too. Bit involved to setup but then red squiggles guide you.

xlfe 2021-07-20T00:54:34.104800Z

+1 red squiggles 🙂