This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-27
Channels
- # aws (7)
- # babashka (145)
- # beginners (83)
- # calva (18)
- # cider (11)
- # clara (9)
- # clj-kondo (59)
- # cljdoc (4)
- # cljs-dev (4)
- # cljsrn (11)
- # clojure (168)
- # clojure-australia (21)
- # clojure-dev (5)
- # clojure-europe (46)
- # clojure-italy (3)
- # clojure-nl (10)
- # clojure-taiwan (1)
- # clojure-uk (55)
- # clojurescript (85)
- # clojureverse-ops (1)
- # code-reviews (3)
- # conjure (22)
- # cursive (3)
- # datahike (3)
- # datomic (4)
- # emacs (5)
- # helix (20)
- # jackdaw (1)
- # jobs (2)
- # jobs-discuss (7)
- # lsp (1)
- # malli (5)
- # off-topic (85)
- # other-languages (4)
- # practicalli (4)
- # reitit (2)
- # releases (2)
- # sci (62)
- # shadow-cljs (181)
- # testing (5)
- # tools-deps (15)
- # xtdb (31)
I deleted borkdude/babashka and borkdude/clj-kondo on Dockerhub now. Let's see how many questions I will get and how many CIs will break... tl;dr: use babashka/babashka and cljkondo/clj-kondo
There we have the first one @thiagokokada :)
Hi, everyone, I'm getting a weird error on clj-kondo for a file:
test/integration/enrollment_view/primary_inclusion_flow.clj:1:1: error: Unresolved symbol:
After running:
clj-kondo --cache false --lint test/integration/enrollment_view/primary_inclusion_flow.clj
I even changed the content of the file to a file that is not failing, but I keep keeting this error.
Did anyone have a similar problem?It was the UTF-8 BOM character 😅 Solved by changing the encoding.
Nervermind! 😅
Is there any way for me to configure the :use linter to not complain about a particular ns? In this case, we like including all the specter vars with refer-all, but if we manually use (:require [com.rpl.specter :refer :all])
it says unresolved symbol on all the uses
@suskeyhose these unresolved symbols should go away when linting the used namespace as well
Ah, I see. Then I wonder why it has unresolved symbol if we put the ns in the require block but not in the use block.
it is all defnav
in specter
if we put it in (:use [com.rpl.specter])
then there are no complaints about unresolved symbols from specter
but with (:require [com.rpl.specter :refer :all])
kondo cannot resolve the symbols from specter
ah I see what the problem is. when using :refer :all
clj-kondo will go out to the cache and see if this info is already there, to give more accurate linting
got it, that makes sense
I tried using lint-as and it didn't appear to fix it, but maybe I need to do something to run it without the cache
@suskeyhose you need to re-lint specter after the config change
So that'd just be by running
clj-kondo --dependencies --lint "$(clojure -Spath)"
right?okay, cool
if specter would package a clj-kondo config in the jar, then you would also get a copy of that in your .clj-kondo
and this way of linting would tell you how to activate that
Perhaps you could suggest this to the specter author, if you find a config that works well: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration
so did it work out now @suskeyhose?
No, and I'm not quite sure why. I set it to lint the defnav calls as defn, (like this https://github.com/redplanetlabs/specter/blob/master/src/clj/com/rpl/specter.cljc#L715-L723), but it's still unable to resolve those symbols.
I was able to validate that it refreshed the cache because some of the symbols it hadn't recognized before it did recognize this time.
just not the defnav ones
can you post your config? also to be sure, just rm -rf .clj-kondo/.cache
and try again
I'll try removing the cache and retrying. The whole config is just
{:lint-as {com.rpl.specter/defnav clojure.core/defn}}
This is the first time we've used a linter on this project, trying to adopt it.
it also suggest trying not to use :refer :all
(for this reason, but also for other reasons, just as a general style recommendation)
oh boy, now it doesn't work in the use block either 😂
Yeah, this is just unfortunate. In any case I'd still be curious if we could customize the :use linter to not complain for particular namespaces.
we avoid :refer :all
like the plague, with the one exception of specter
because that's a lot of short & common symbols that we do not want to prefix with s/
I'll see if I can make a tiny thing that reproduces the error.
I will take a look tomorrow and will call it a day, it's getting close to midnight here.
many thanks @borkdude
Oh that's funny, it thinks it's C++
I forgot to remove the .cpcache, but whatever
@suskeyhose I think I see the issue. The defnav
macro, in .clj at least, is a locally defined using another macro. In cljs it works differently.
Right, but if I have it lint-as defn, wouldn't that remove the issue? It seems odd that I'd have to change how defmacroalias is linted too
yep, that's it:
{:lint-as {com.rpl.specter/defnav clojure.core/defn
com.rpl.specter/defmacroalias clojure.core/def}}
this worksOkay, cool. Well I'll go for that. Thanks!
Feel free to contribute the config here: https://github.com/clj-kondo/config once you have it all working
Or perhaps in the specter repo itself: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration
Excellent! I have a feeling that a lot of specter users do refer all the symbols... contributing this kondo config to specter might make sense
Sounds good, I'll look at making a PR in specter