This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-02
Channels
- # announcements (11)
- # aws (2)
- # babashka (42)
- # beginners (26)
- # calva (17)
- # cider (1)
- # clara (2)
- # clj-kondo (44)
- # clojars (30)
- # clojure (43)
- # clojure-australia (6)
- # clojure-europe (29)
- # clojure-gamedev (4)
- # clojure-greece (1)
- # clojure-nl (4)
- # clojure-spec (4)
- # clojure-uk (6)
- # clojurescript (28)
- # cursive (16)
- # data-science (1)
- # datahike (4)
- # datomic (26)
- # emacs (6)
- # events (3)
- # fulcro (11)
- # graalvm (7)
- # holy-lambda (118)
- # java (9)
- # jobs (1)
- # leiningen (3)
- # lsp (21)
- # luminus (2)
- # malli (13)
- # membrane-term (1)
- # music (1)
- # nrepl (3)
- # off-topic (38)
- # pedestal (2)
- # polylith (39)
- # re-frame (33)
- # reagent (7)
- # releases (1)
- # remote-jobs (4)
- # rewrite-clj (28)
- # ring (21)
- # sql (2)
- # tools-deps (23)
- # vim (4)
- # xtdb (15)
Hello, I have {:lint-as {promesa.core/let clojure.core/let}}
in .clj-kondo/config.edn
and I am seeing Unresolved symbol: a
for (p/let [a 12])
- is this expected behaviour?
it happens in the p/let
at the bottom of this: https://github.com/chr15m/create-sitefox-nbb/blob/main/template/server.cljs
the clj-kondo config is in that same dir.
Can't reproduce. Can you execute clj-kondo --lint server.cljs
on the command line and see what it produces? Are you sure this is coming from clj-kondo and not some other linter?
Oh maybe you're right, maybe my setup is wrong. I'll investigate, thanks.
/home/chrism/bin/clj-kondo --lint - < server.cljs
<stdin>:32:11: error: Unresolved symbol: self
If I directly run it it fails to find the file, even though it's definitely there:
$ /home/chrism/bin/clj-kondo --lint server.cljs
server.cljs:0:0: error: file does not exist
linting took 31ms, errors: 1, warnings: 0
I installed from the AppImage by copying it into ~/bin
which is on my path. :thinking_face:$ pwd
/home/chrism/dev/create-sitefox-nbb/template
$ clj-kondo --lint server.cljs
server.cljs:0:0: error: file does not exist
linting took 31ms, errors: 1, warnings: 0
$ ls -alh server.cljs
-rw-rw-r-- 1 chrism chrism 1.3K Oct 31 13:08 server.cljs
could this be a strange bug with the appimage version not resolving paths correctly?
maybe i shouldn't be doing this?
$ ls -alh ~/bin/clj-kondo
lrwxrwxrwx 1 chrism chrism 75 Oct 27 13:04 /home/chrism/bin/clj-kondo -> contrib/clj-kondo-2021.09.25-lp151.73.1.Build73.1.glibc2.14-x86_64.AppImage
I don't know what appimage is. Just install it from github releases using the installer script
oh ok, its linked from the clj-kondo docs
> There is also an https://download.opensuse.org/repositories/home:/zilti:/clojure/AppImage/clj-kondo-latest-x86_64.AppImage. If you use the AppImage, simply save the file as "clj-kondo" and make it executable. It is fully self-contained - without the overhead that comes with Docker!
Ok using the installer with --dir /home/chrism/bin
has fixed the issue. Sorry for the noise!
Thanks for your hlep.
Added by zilti: https://github.com/clj-kondo/clj-kondo/commit/fcbab419ced4abb538ae2715d7db5b560aaff488 I'll contact him. Thank you.
Hey @borkdude is there a good way for me to specify in clj-kondo hooks that a value is bound, but we don't know to what? I can't use an anonymous function because that causes incorrect behavior wr/t recur linting, and if I bind the values to nil
in a let block then I get type errors in the code inside it.
The solution I ended up coming up with is to emit a let block that looks like this:
(let [some-binding (clojure.core/first nil)]
(+ some-binding 2))
The problem before was that some-binding
was giving me warnings about being nil and passed to +
, so more or less I wanted to emit an untyped binding form.I don't really consider this ideal, but it's good enough I guess
@suskeyhose bind to a number perhaps? or does that also cause type errors for other situations?
it also causes type errors
for anything that like needs a sequence
The hook is controlling what value is bound
it's not in my code
practically speaking it's like making a function call, but there's no actual function call boundary and recur goes back to an outer recur point
(loop []
(restart-case
(far/error ::some-error)
(::far/use-value [v]
(recur))))
This recur
will recur back to loop
, but the ::far/use-value
clause is called like a function (in some handler on a different part of the stack)so this is a macro which expands the keyword ::far/use-value
into something like fn
?
it's like fn, but in reality it's like getting the values out of an exception and destructing them inside a let
statement
the expansion is.... complex
(loop []
(let [[v] (try (far/error ::some-error)
(catch Signal s (.-args s))]
(recur)))
that's more or less what it ends up doing, but very simplified
I think you could just expand into something like
(let [{:keys [v] {}] ..)
clj-kondo isn't currently looking at the contents of the map literal to deduce that v is nil
okay, I can try that.
@suskeyhose off topic question: did you get anything working in graalvm jdk 17 with panama + native image?
I had some other stuff that took a lot of my free time, so I haven't had the chance yet.