This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-04
Channels
- # announcements (5)
- # aws (11)
- # babashka (15)
- # beginners (101)
- # biff (14)
- # calva (45)
- # clj-kondo (18)
- # cljs-dev (5)
- # clojure (178)
- # clojure-austin (5)
- # clojure-europe (8)
- # clojure-france (1)
- # clojure-nl (12)
- # clojure-norway (6)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (13)
- # community-development (2)
- # conjure (6)
- # cursive (8)
- # datahike (1)
- # datalevin (3)
- # datascript (36)
- # datomic (6)
- # emacs (2)
- # etaoin (2)
- # fulcro (5)
- # graalvm (6)
- # gratitude (3)
- # introduce-yourself (1)
- # jobs-discuss (1)
- # lsp (19)
- # malli (4)
- # nbb (11)
- # off-topic (4)
- # other-languages (1)
- # pathom (19)
- # pedestal (1)
- # shadow-cljs (22)
- # spacemacs (16)
- # tools-deps (31)
- # vim (7)
I am trying to make a custom macro to be linted as one in another library, specifically I want a while-let
macro in a library to be linted as better-cond.core when-let
, I have this on clj-kondo.exports
{:lint-as {bortexz.utils.core/while-let better-cond.core/when-let}}
But can’t make it work, on a third library using bortexz.utils.core
, both the exported config.edn ’s appear con .clj-kondo (both better-cond config.edn and utils.core config.edn). When I change to lint as clojure.core/when-let, it works properly and doesn’t complain. Any clue how can I solve this? Thanks!I am requiring better-cond
in bortexz.utils.core
, and also tried from the library that uses bortexz.utils.core directly instead of transitively, couldn’t make it work (although the better-cond config.edn works fine)
Hi @U04V15CAJ were you able to have a look at this? Do you want me to open an issue? specifically, in this file https://github.com/bortexz/kondo-exports-issue-repro/blob/main/src/bortexz/kondo_exports_issue_repro.clj for me using Calva it lints the v
as being unresolved symbol in while-let
, although in .clj-kondo both of these config.edn exist (exported from their own libraries)
;; bortexz.utils.core
{:lint-as
{bortexz.utils.core/while-let better-cond.core/when-let
bortexz.utils.core/while-some better-cond.core/when-some}}
;; better-cond.code
{:hooks
{:analyze-call
{better-cond.core/cond better-cond.core/cond-hook
better-cond.core/defnc better-cond.core/defnc-hook
better-cond.core/defnc- better-cond.core/defnc-hook
better-cond.core/if-let better-cond.core/if-let-hook
better-cond.core/if-some better-cond.core/if-let-hook
better-cond.core/when-let better-cond.core/when-let-hook
better-cond.core/when-some better-cond.core/when-let-hook}}}
In my project, clj-kondo does not seem to detect invalid arity errors on method calls coming from dependencies that are imported with :local/root
in my deps.edn
. Do I need to specify something in particular to enable it?
Dependencies are linted when you provide the classpath. See https://github.com/clj-kondo/clj-kondo/#project-setup
Does anyone has an example of a project, where the same code is reused between sorce code and clj-kondo hook?
That's not really something I'd do without just copying the code. I guess you could like symlink a file into the directory and get it with require, but that severely limits what you can do in that utility file.