Fork me on GitHub
#clj-kondo
<
2022-08-25
>
Drew Verlee15:08:12

I see there is work on add what looks like some default linting for compojure https://github.com/clj-kondo/clj-kondo/commit/e5f8af54590b084cc119263698bdc786bfc6434f. But it doesn't seem on by default, and i'm not seeing how i enable it. the GET macro is still reporting errors:

Drew Verlee15:08:36

add this to the clj-kondo config will ignore it i hope

Drew Verlee15:08:01

:linters {unresolved-symbol {:exclude [(compojure.api.sweet/GET) ]}} looks like no one built a custom hook, i don't plan on doing it either.

hiredman15:08:27

That isn't composure though

Drew Verlee15:08:29

the require is [compojure.api.sweet :as sw]

hiredman15:08:40

Yeah, that is not compojure

hiredman15:08:59

That is whatever that sweet api thing built on compojure is

Drew Verlee15:08:16

apologies for the confusion, when i google "compojure" the first thing that comes up is compojure-api and the hello world is (require '[compojure.api.sweet :refer :all]) so i was considering it compojure. because it has the name compojure in it.

Drew Verlee15:08:38

should have said "compojure.api.sweet"

hiredman15:08:39

https://github.com/metosin/compojure-api is what you are using, https://github.com/weavejester/compojure is what is being referred to as compojure in that commit

Drew Verlee15:08:21

err maybe i was googling for compojure api, thanks for the clarification.

hiredman15:08:58

it was an unfortunate choice of name they went with

hiredman16:08:53

fortunate for them, good for marketing their new (at the time) library, unfortunate for the community now having two easily confusable library names

Drew Verlee16:08:53

is there a way to exclude an entire namespace, that i don't control, from being linted?

Drew Verlee16:08:59

looks like regex might be supported

borkdude16:08:14

if you don't control the namespace, why do you care about linting results for that one?

Drew Verlee16:08:27

my project has a multiple namespaces that require [compojure.api.sweet :as sw] ideally it would be properly linted, but i'm not sure i's worth taking the time to do, so i'm looking for a way to quickly ignore everything from that namespace so it's easier to see other more important/better error reporting. This is working but it's obviously not comprehensive.

{:unresolved-symbol {:exclude
                  
                        [(compojure.api.sweet/GET)
                           (compojure.api.sweet/POST)
                           (compojure.api.sweet/PUT)]}}

Drew Verlee16:08:51

by "dont' control" i mean, i can't change the namespace that contains the macro. I though that might be relevant to understanding my options.

borkdude16:08:58

you can use :output {:exclude-files ["regex"]}

๐Ÿ‘€ 1
Drew Verlee17:08:17

can you have multiple config.edn's in your project's .clj-kondo directory? it looks like i "somehow" (lsp?) added a /.clj-kondo/prismatic/schema/config.edn

borkdude18:08:23

@drewverlee This happens when you extract configurations from dependencies. They are included automatically

๐Ÿ‘ 1
Drew Verlee18:08:44

thats what i was hoping happened. ty tyt.

Cora (she/her)20:08:23

hmmm seems like flycheck-clj-kondo is picking the wrong directory to look for the .clj-kondo directory

Cora (she/her)20:08:15

I guess that might be flycheck itself being weird

borkdude20:08:31

๐Ÿงต

Cora (she/her)20:08:40

๐Ÿ‘‹:skin-tone-2:

borkdude20:08:48

flycheck runs over a file while setting the current working directory to the file's parent. clj-kondo then searches for the .clj-kondo directory from that directory to the top and takes the first one that it finds

Cora (she/her)20:08:19

so if the file is /foo/bar/baz.clj it would first check /foo/bar/.clj-kondo then /foo/.clj-kondo then /.clj-kondo?

Cora (she/her)20:08:39

something is fucky then because it's skipping the deeper-nested .clj-kondo and going one directory up

Cora (she/her)20:08:56

I use doom emacs so it could very well be something doom is doing

Cora (she/her)20:08:00

I'm looking deeper into it

borkdude20:08:52

I'll be asleep now and will check back tomorrow

Cora (she/her)21:08:00

thanks! sleep well ๐Ÿ™‚

Cora (she/her)21:08:45

ok, it's using lsp for clj-kondo and that's finding the wrong project root