This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-29
Channels
- # aleph (3)
- # announcements (16)
- # beginners (85)
- # calva (2)
- # cider (13)
- # clj-kondo (84)
- # cljdoc (3)
- # clojure (109)
- # clojure-belgium (1)
- # clojure-china (39)
- # clojure-europe (4)
- # clojure-france (1)
- # clojure-italy (70)
- # clojure-nl (8)
- # clojure-spec (8)
- # clojure-uk (53)
- # clojuredesign-podcast (14)
- # clojurescript (43)
- # cursive (25)
- # data-science (1)
- # datomic (4)
- # emacs (10)
- # figwheel (4)
- # garden (4)
- # graphql (5)
- # jackdaw (10)
- # jobs (5)
- # jobs-discuss (5)
- # lambdaisland (2)
- # leiningen (3)
- # luminus (7)
- # off-topic (32)
- # pathom (11)
- # pedestal (2)
- # planck (15)
- # re-frame (12)
- # reagent (4)
- # remote-jobs (2)
- # shadow-cljs (51)
- # sql (29)
- # tools-deps (47)
@borkdude no only joker
It’s working fine in Ubuntu machine
But I need more info on windows machine
Thank you
it seems you are linting in two steps, one to populate the cache and one for results you want to see. this is unnecessary, you can use the config to show only results of files you're interested in
clj-kondo has no notion of "current dir", it just lints whatever you give it, but it does handle relative paths
for the cache building part we ignore errors, so dependency source issues don’t fail the build
@U08E8UGF7, I just tried it and it works over here. If you only want your sources included, one tip is to prefix your dirs with ./ for example:
:output {:include-files ["./src" "./test" "./modules"]}
oh right… I took a shortcut, cljdocs contains a few tiny sub-projects under modules. So I build my cache with the main deps.edn and use it against the sub-projects. So… I might stick with my 2 step shenanigans for now.
oh gee. yeah why not? I think I might have been fixated on building that cache separately as prep step. thanks.
src is probably already in the path the clojur provides, so just add test and modules
those modules also already seem to be on the path: https://github.com/cljdoc/cljdoc/blob/master/deps.edn#L58
hmmm… good points… oh… deps.edn does not include all modules… you’ve given me great guidance… thanks for your patience!
actually you need both -R and -C test, R to get the test deps and C to include the test dir itself. I don't know if there is anything in tools.deps that combines those
sorry, missed this one! good question. the script is meant for developers and ci. ci won’t make use of the cache.
yeah I saw that… and thought it was a bit preachy… I probably don’t understand the rationale… if that is the idiom clojure authors are recommending I should follow suit.
the reason is that empty? calls seq again, so (not (empty? ...)) is really (not (not (seq ...)), but then you could just write (seq ...)
that’s just an implementation detail though, no? The (not (empty? x))
reads pretty clearly to me. That said, I’m going to go with the flow and use (seq x)
. I’m getting more used to it as we chat about it.
as for destructuring: feel free to post an issue in clj-kondo. it seems a thing people want to be doing in function arguments without getting warnings.
so maybe something like {:unused-bindings {:arguments false}}
but that would turn off the warning for all function arguments
@lee https://github.com/borkdude/clj-kondo/issues/382, I think that's how I want to support it
there is a nuance I noticed: people sometimes leave in an unused :as x to describe the overall type.
I think your config is good, but might not be extensible should you want to, in the future, exclude other types of things?
it's extensible by just adding a new key for that scenario, but right now I haven't come across many other situations where I would want to suppress these messages. maybe the :as
is a good one, but we can just fit that under this option I guess
joker has some options for this, but they are a bit too coarse: like, turn off everything always in function arguments
There is a new rule :unused-keys (defaults to true) which applies to :keys, :strs, and :syms bindings.
This is what joker calls itjust remembered another interesting case: defmulti: example: https://github.com/cljdoc/cljdoc/blob/d77e5918ddd356a97b95281153e0c8a53866e1e9/src/cljdoc/render.clj#L20
maybe just:
{:linters {:unused-binding {:destructured-fn-args false}}} ;; defaults to true
@lee I would do that like this:
(defmulti render (fn [page-type _route-params _cache-bundle] page-type))
(defmethod render :default
[page-type _ _]
(format "%s not implemented, sorry" page-type))
I’m just looking are your default clj-kondo config. You do use the the key :exclude for other things.
ya when I clj-kondofied, I prefixed with underscores. Makes sense to me, I think others would agree?
I'm usually using the key :exclude for things like vars and namespaces, but :exclude [:destructured-fn-args] would be a bit weird
you can also disable the entire linter in just one namespace, using a namespace local config
I didn't document it until the previous release, but it's been there for a while, mostly for my own debugging