This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-01
Channels
- # announcements (4)
- # aws (1)
- # beginners (60)
- # calva (10)
- # cider (21)
- # clj-kondo (38)
- # cljdoc (1)
- # clojure (59)
- # clojure-austin (1)
- # clojure-conj (1)
- # clojure-europe (19)
- # clojure-italy (9)
- # clojure-nl (29)
- # clojure-spec (6)
- # clojure-uk (85)
- # clojurescript (54)
- # community-development (11)
- # core-async (2)
- # cursive (21)
- # data-science (4)
- # datomic (39)
- # events (2)
- # fulcro (48)
- # funcool (1)
- # graalvm (5)
- # jackdaw (9)
- # kaocha (17)
- # luminus (2)
- # off-topic (10)
- # parinfer (22)
- # quil (1)
- # re-frame (4)
- # reagent (29)
- # shadow-cljs (7)
- # sql (9)
- # tools-deps (31)
- # yada (1)
Is it possible to have one clj-kondo config for all projects (eg. in home directory)? I have set of macros which cause an arity false positive error. I don't want to add exclusion for each and every project which uses it.
@tsulej the binary accepts a --config
flag which you can use for bringing in additional config. maybe that works for you?
it's a little bit discouraged to scatter config over multiple places because it should ideally be in the same git repo as your code, so your collaborators don't have to re-invent that
You're right in general. But in my case I have a bunch of clojure2d sketches here and there as separate projects and they all are filled with kind of threading macros (there are two actually).
Maybe the other option: I work with emacs and flycheck, how to feed flycheck with custom config then?
the --cache
option is no longer needed, it has become the default. so you can leave that out
@borkdude now I'm getting
Suspicious state from syntax checker clj-kondo-clj: Flycheck checker clj-kondo-clj returned non-zero exit code 124, but its output contained no errors: Unexpected error. Please report an issue.
java.lang.ClassCastException: java.lang.String cannot be cast to java.io.File
at clj_kondo.impl.core$read_edn_file$fn__4643.invoke(core.clj:51)
at clj_kondo.impl.core$read_edn_file.invokeStatic(core.clj:51)
at clj_kondo.impl.core$resolve_config.invokeStatic(core.clj:62)
at clj_kondo.core$run_BANG_.invokeStatic(core.clj:83)
at clj_kondo.main$main.invokeStatic(main.clj:85)
at clj_kondo.main$main.doInvoke(main.clj:78)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:665)
at clj_kondo.main$_main$fn__4787.invoke(main.clj:104)
at clj_kondo.main$_main.invokeStatic(main.clj:104)
at clj_kondo.main$_main.doInvoke(main.clj:102)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clj_kondo.main.main(Unknown Source)
Try installing a more recent version of clj-kondo-clj, and please open a bug report if the issue persists in the latest release. Thanks!
when using config containing
{:linters {:invalid-arity {:skip-args [clojure2d.core/with-canvas->
clojure2d.core/with-canvas]}}}
and line in my init.el (flycheck-clj-kondo-define-checkers "--config" "~/.emacs.d/clj-kondo-config.edn")
I think clj-kondo doesn't interpolate ~
but maybe you can fix that using some emacs lisp wizardry
Bringing back https://github.com/borkdude/clj-kondo/issues/241#issuecomment-507370830
Not sure if this is up for discussion, but wondering if this would be a better way to show side-effects?
(ns foo
(:require foo.specs ;; <-- leave as is
[bar.utils :as bu] ;; <-- unused, free to remove
,,,))
That would be against "how to ns" advice. Also it's not what most people are already doing.
This option has been suggested in that thread and maybe had some other drawbacks that I can't remember off the top of my head right now.
One thing was maybe that in CLJS you can have strings for ns names and maybe that didn't work outside a vector or something. Not sure
No problem, couldn't see that in the thread when I scanned but that makes sense
I think capturing what most people already seem to be doing is best for a linter, since adoption will be less painful
I think @danielcompton example works. clj-kondo doesn't complain about naked requires as in (:require clojure.string)
produces no warnings. I use that convention on my projects.
I use non aliased requires all the time, I still want them marked if they're not in use.
It's hard to please everyone. I remember the thread where this was discussed. It was long an full of opinions.
I wonder if unused-symbols could be a :warning
by default. It's the only :info
on default configuration and Ale
doesn't show that on vim 😕 and there is no way to have a global config for clj-kondo
afaik.