This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-12
Channels
- # adventofcode (67)
- # announcements (8)
- # babashka (46)
- # beginners (154)
- # calva (5)
- # cider (9)
- # clara (5)
- # clj-kondo (34)
- # cljdoc (31)
- # cljsrn (4)
- # clojure (146)
- # clojure-europe (5)
- # clojure-italy (3)
- # clojure-losangeles (2)
- # clojure-nl (149)
- # clojure-spec (22)
- # clojure-uk (73)
- # clojured (6)
- # clojurescript (95)
- # clojureverse-ops (3)
- # cryogen (7)
- # cursive (12)
- # data-science (1)
- # datomic (9)
- # docker (1)
- # emacs (1)
- # figwheel-main (1)
- # hyperfiddle (1)
- # jobs (3)
- # malli (29)
- # nrepl (2)
- # off-topic (61)
- # pathom (6)
- # pedestal (1)
- # planck (1)
- # reitit (19)
- # shadow-cljs (52)
- # spacemacs (5)
- # tools-deps (24)
- # vim (30)
- # yada (6)
why is the following snippet giving me an unresolved symbol
error for the ~@args#
declaration?
(defn example
[name]
`(defmacro ~name [& args#]
`(foo ~(keyword '~name) ~@args#)))
@alidcastano Because the author did not know that syntax-quotes are allowed to be nested
how to tell kondo it's ok?
@teawaterwire what version of clj-kondo are you using and which editor / plugin?
sorry yes more details: vscode with calva it's on clojurescript code i'm tagging a symbol to be treated as js
only cljs
yes trying to isolate a simple snippet
i tried this mini-snippet
can you please just paste the code instead of screenshots? then I can repro it myself
I'll make an issue for it. meanwhile you can add this symbol to your .clj-kondo/config.edn config
sorry for the screenshot thank you for the answer!
Question regarding HugSQL but I think it speaks to a more general (potential) issue: I'm not sure if anyone has used HugSQL, but it dynamically defines clojure functions based on a markup syntax within the comments of an SQL file. As one might imagine, clj-kondo
has no context/understanding that these functions exist (they are generated by loading the SQL file with a function that HugSQL provides). Any thoughts on how to handle HugSQL specifically and, perhaps more importantly, how to handle dynamically generated functions (i.e. functions that are produced via calls to eval
, etc.)?
@mafcocinco see https://github.com/borkdude/clj-kondo/blob/master/doc/config.md, hugsql is mentioned there
Cool, makes sense as the declare
call will introduce the symbol in a context that clj-kondo
knows about. Clever solution. Thanks.
Yeah, I generally have a wrapper clj
file that should be included to use the hugsql functions, which avoids redundant declarations of the functions. Would be easy to add the declare
statements in those files. Also has the side benefit of surfacing the names of the functions that the SQL file provides without the user having to dig into the SQL file.
👋 is this a known issue or am I doing something weird here, or just missing something?
;; clj-kondo is warning about this first line: warning: unused binding alias-sym
(doseq [[ns-sym _ alias-sym] (cons t ts)]
(create-ns ns-sym)
(alias alias-sym ns-sym))
I’m using v2019.11.23 with the default config.