Fork me on GitHub
#clojure-australia
<
2021-07-20
>
Hugh Powell00:07:27

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

Oliver George00:07:04

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

Hugh Powell00:07:58

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 George00:07:28

Here's my TLDR

xlfe00:07:45

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

Oliver George00:07:12

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 George00:07:26

Then ran clojure -X:lint-ns

Oliver George00:07:51

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

xlfe00:07:08

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

Oliver George00:07:29

similar / overlapping

xlfe00:07:48

ah :thumbsup:

Oliver George00:07:49

I suspect it's a superset / overlap of carve

Oliver George00:07:05

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

Oliver George00:07:48

I've found carve useful and reliable.

xlfe00:07:08

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

xlfe00:07:24

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

xlfe00:07:28

ie cleanup things one by one

xlfe00:07:59

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

Oliver George00:07:12

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

Oliver George00:07:13

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.

xlfe00:07:25

ah right - the clean-ns does sound useful

xlfe00:07:13

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

Oliver George00:07:01

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

xlfe00:07:34

+1 red squiggles 🙂