This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-09
Channels
- # announcements (17)
- # babashka (8)
- # beginners (68)
- # calva (28)
- # clj-kondo (36)
- # cljsrn (1)
- # clojure (232)
- # clojure-dev (3)
- # clojure-europe (13)
- # clojure-nl (14)
- # clojure-spec (9)
- # clojure-uk (11)
- # clojuredesign-podcast (3)
- # clojurescript (38)
- # core-async (3)
- # cursive (1)
- # datahike (4)
- # datomic (4)
- # fulcro (56)
- # graphql (1)
- # helix (3)
- # honeysql (5)
- # introduce-yourself (1)
- # kaocha (2)
- # lsp (67)
- # malli (7)
- # meander (2)
- # off-topic (1)
- # pathom (9)
- # re-frame (55)
- # reitit (3)
- # releases (8)
- # remote-jobs (12)
- # shadow-cljs (12)
- # sql (3)
- # tools-deps (55)
- # vim (5)
- # xtdb (3)
So I’m using a music creation library overtone.live
. The examples tend to add it into the namespace with :use
or :refer :all
. It makes sense to do this since there isn’t likely to be any collisions with clojure.core
and it’s the only library I tend to use in overtone projects.
I already got clj-kondo to stop linting :use
and :refer :all
by adding :linters {:refer-all {:exclude [overtone.live]}}
to my kondo config.edn
. Now it gives me “Unresolved symbol” when I see why all symbols in the namespace are underlined red. What can I do about this?
@c.westrom What you can do about this is lint the overtone library while also having a .clj-kondo
directory
I don’t understand. Do you mean clone overtone.live and then run clj-kondo in a separate terminal to lint it? @borkdude
@c.westrom You are not using overtone.live
as a dependency in a clojure project?
Deps.edn, everything works fine when I require overtone.live :as ol
or something like that.
I just don’t want to have to write ol/
before everything.
@c.westrom ok, then try as documented in the link I gave you:
mkdir -p .clj-kondo
clj-kondo --lint $(clojure -Spath) --dependencies
oh, I think I see the issue with this.
overtone uses a custom macro to import its vars...
https://github.com/overtone/overtone/blob/master/src/overtone/live.clj
so unfortunately the combination of :use
+ that namespace won't work very well. you might as well disable the unresolved symbol linter in this namespace :/
overtone could have a hook for its macros right? then it would work for clj-kondo if user configure to use the hook, right?
that's correct, but the macro doesn't give very much to go by. it's basically "copy that namespace to here"
well, what you could do is write a hook for this macro and just hard-code the var defs
Oh, so it’s an overtone thing. I even tried intellij to see if it was just emacs jank causing the issue.
you could write a hook which generates
(declare osc chance ...)
from the macro call.
All the vars are here:
https://github.com/overtone/overtone/blob/02f8cdd2817bf810ff390b6f91d3e84d61afcc85/src/overtone/api.clj#L53so you would write a hook that expands a call to
(overtone.api/immigrate-overtone-api)
into
(declare osc chance ...)
, then you re-initialize lsp by throwing away .lsp/sqlite.db
and .clj-kondo/.cache
+ editor restartThis is a hook example that maybe can help you: https://github.com/nubank/state-flow/blob/master/resources/clj-kondo.exports/nubank/state-flow/nubank/state_flow.clj