Fork me on GitHub
#clj-kondo
<
2021-08-06
>
Noah Bogart13:08:17

I’m using Specter (https://github.com/redplanetlabs/specter) in my current project and clj-kondo can’t seem to resolve some of the “navigators” (https://github.com/redplanetlabs/specter/wiki/List-of-Navigators):

Noah Bogart13:08:53

the code runs fine, but it seems that the way specter defines them makes it hard for kondo to follow correctly

Noah Bogart14:08:11

is there anything i can do to make this work without adding every navigator to my .clj-kondo/config.edn file?

Noah Bogart14:08:27

oops, i am ashamed to have missed that lol

borkdude14:08:02

I think this could be added to the clj-kondo.exports part of the specter lib

👍 3
borkdude14:08:08

then it would have worked almost automatically

borkdude14:08:23

but then the maintainer would have to accept that :)

Noah Bogart14:08:20

that’s very cool, thank you

dharrigan14:08:31

thank you too! added 🙂

borkdude14:08:39

What are you referring to here?

dharrigan14:08:53

the lint-as block

dharrigan14:08:00

I'm not part of the spectre team 🙂

borkdude14:08:17

Do Noah and you work together?

borkdude14:08:27

I missed that part of the context

dharrigan14:08:20

No, sorry. I should have been more specific. Thank you for the link to the spectre#clj-kondo information. I didn't see that too. I've added that to my clj-kondo config file as well.

Joshua Suskalo14:08:23

Yeah, I added that config a while back @nbtheduke. It may end up eventually needing some more stuff though, so let me know if you run into anything unrecognized or linting weirdly and we can collaborate on that config before making another pr to the repo.

Noah Bogart21:08:39

Oh wow is specter under your umbrella?

Joshua Suskalo21:08:57

I use it all the time and I contributed that config to the repo, but I'm not a frequent contributor or anything.

👍 3
Joshua Suskalo14:08:45

Also @borkdude I asked the author of specter if he wanted to have the config in the artifact and he said no since it increases the size of the artifact (if only slightly) and the number of people who use clj-kondo is still a minority.

borkdude14:08:51

Then perhaps contributing it to https://github.com/clj-kondo/config is a good second option

borkdude14:08:59

or just do both

Joshua Suskalo14:08:46

I'd be happy to contribute it there if it'd be accepted.

borkdude14:08:52

(I mean README + clj-kondo/config)

borkdude14:08:58

or link from README to clj-kondo/config

borkdude14:08:23

anyway, this will always be an issue (being at the mercy of library maintainers), so clj-kondo/config seems like something which is always possible and perhaps clj-kondo itself could look for config over there automatically in the future

borkdude14:08:57

the nice thing about having the config with the library itself is that the config can be maintained per library version

Joshua Suskalo14:08:38

Could have like a --contrib-configs flag when using --copy-configs that'd check for it in this repo.

Joshua Suskalo14:08:25

Then the repo could become just community-maintained configs that people can use, while still leaving the option for the lib maintainers to publish one that doesn't conflict in the future. I like that idea a lot.

Noah Bogart21:08:56

Reminds me of DefinitelyTyped, the npm packages that add Typescript definition files for JavaScript libraries. Maybe this could be the same?

borkdude21:08:48

I've also heard that being mentioned

Noah Bogart21:08:56

Reminds me of DefinitelyTyped, the npm packages that add Typescript definition files for JavaScript libraries. Maybe this could be the same?