Fork me on GitHub
#clj-kondo
<
2021-05-19
>
Felipe Marques17:05:10

Hi, everyone, Is there some lib or rewrite-clj script that performs some basic fixes like remove unused namespaces or remove unused binding reported by clj-kondo?

borkdude17:05:05

Perhaps there are also girls here :) I think #lsp can possibly help you with that. Unused namespaces for sure.

Felipe Marques17:05:46

Sorry! 😅 Going to use a more gender neutral term next time!

borkdude17:05:27

No worries, I just want to make sure that there can also be girls here :)

Felipe Marques17:05:06

You're are totally right!

borkdude17:05:52

In the future https://github.com/borkdude/carve may also try to do this, but it doesn't currently

Felipe Marques17:05:47

Cool! Thanks for the info, going to take a lot in it.

lilactown17:05:15

I've just started using clj-kondo and I'm trying to figure out how to configure it in our monorepo

lilactown17:05:40

is there a way for clj-kondo to tell me what config file it is detecting?

borkdude17:05:13

@lilactown clj-kondo walks up to the first .clj-kondo dir it encounters

4
borkdude17:05:48

personally I create a .clj-kondo for each project in a mono-repo

lilactown17:05:13

why is that?

lilactown17:05:47

we have a lot of projects 😬

borkdude17:05:35

smaller configs have better startup time :)

borkdude17:05:47

also we have some projects with overlapping namespaces

borkdude17:05:13

if that isn't a problem, you can choose to have only one .clj-kondo dir, but this also makes linting your classpaths a bit more complicated I think

lilactown17:05:28

yeah that's what i'm thinking through rn

borkdude17:05:37

you could script it using babashka or so

borkdude17:05:14

you can also put common config into one directory and then refer to it using :config-paths

lilactown17:05:26

first step is I want editor integrations to work well, since a lot of our jr devs are using VS Code + Calva and running into lots of squigglies due to our custom macros

lilactown17:05:18

perhaps that's the best; create common configurations for e.g. services, ui, libraries in the top-level and then each project can refer to the appropriate one

lilactown17:05:50

I suppose for step 2, linting in CI, I would want to run clj-kondo in each sub project, or script it with babashka like you were saying?

borkdude17:05:14

yeah, you can do that, just iterate through the projects.

lilactown19:05:38

I ended up creating a shared config in our app root:

.clj-kondo/ui/config.edn
and added configs to our ui projects that refer to it via :config-paths . it's working well, and gives us room to add service and api configs later. thanks for the guidance! 😄

👍 3