Fork me on GitHub
#clj-kondo
<
2020-01-06
>
Björn Ebbinghaus15:01:07

I get Unresolved namespace warning with a location that doesn't make sense. The code where the warning is boilerplate and has nothing to do the missing requirement it warns me about. line and column are pointing to whitespace. Even if I require the namespace I still get the warning. Details about the warning and it's location. ./src/main/decide/server_components/config.clj:17:27: warning: Unresolved namespace decide.server-components.ldap. Are you missing a require? https://github.com/hhucn/decide/blob/master/src/main/decide/server_components/config.clj#L17:27

borkdude15:01:17

@mroerni I've pasted that file in a local file here and I don't get this warning. Maybe something is up with your editor?

borkdude15:01:06

This is the output I'm getting:

$ clj-kondo --lint foobar.clj
foobar.clj:20:11: error: unresolved symbol config
linting took 13ms, errors: 1, warnings: 0
Maybe you can try the same.

Björn Ebbinghaus15:01:15

Hmm... Only clj-kondo --lint . has the warning. 😕

borkdude15:01:52

Ah, only if you lint the entire dir?

borkdude15:01:16

I'll try the repo

Björn Ebbinghaus15:01:24

clj-kondo --lint src -> Warning clj-kondo --lint src/main -> No warning

borkdude15:01:48

it's coming from your user file

borkdude15:01:30

I'm not sure why the filename is wrong there

borkdude15:01:02

that's definitely a bug. a small repro of this + an issue would be nice

Björn Ebbinghaus14:01:08

Done. Don't know how to make a better repro than the commit in the repo, since the problem is not reproducible in a single file. https://github.com/borkdude/clj-kondo/issues/691

borkdude14:01:28

ok, thanks!

thumbnail21:01:42

hi 👋:skin-tone-2: first off thanks for clj-kondo :thumbsup::skin-tone-2: Really solid stuff. I noticed clojure.core/bound-fn was giving me unresolved symbol errors. By adding :lint-as {clojure.core/bound-fn clojure.core/fn} to the config this was resolved though.

borkdude21:01:31

Thanks. Feel free to post an issue about this.

borkdude21:01:23

Create an issue with the problem and the workaround. I'd first like to see why bound-fn wasn't recognized in clj-kondo and inspect the root error

4
thumbnail21:01:39

Figured as much. will do

borkdude21:01:07

Ah I see. clj-kondo recognizes that symbol, but doesn't lint it correctly. The config makes sense, but should probably be built into analyzer.clj. PR for that is welcome.

4
borkdude21:01:22

The place where it should be added is analyze-call

thumbnail21:01:31

I’ll create the issue and look into a PR soon 🙂 Thanks for the pointer

borkdude21:01:24

thank you too! I saw on Github that you live in Overijssel, that's where I come from too (but I don't live there anymore)

thumbnail22:01:34

It’s such a small country :flag-nl:

borkdude22:01:18

check out #clojure-nl as well

thumbnail22:01:33

I’m actually already in that group 😅 just pretty passive usually.