This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-06
Channels
- # babashka (19)
- # beginners (68)
- # calva (9)
- # cider (27)
- # clj-kondo (64)
- # clj-on-windows (2)
- # cljdoc (8)
- # clojure (11)
- # clojure-europe (58)
- # clojure-italy (1)
- # clojure-nl (23)
- # clojure-uk (5)
- # clojurescript (9)
- # cryogen (18)
- # cursive (14)
- # data-science (17)
- # emacs (6)
- # gorilla (6)
- # graphql (1)
- # gratitude (2)
- # holy-lambda (10)
- # introduce-yourself (1)
- # jackdaw (3)
- # jobs (1)
- # leiningen (2)
- # malli (3)
- # missionary (33)
- # off-topic (21)
- # pedestal (7)
- # polylith (8)
- # quil (3)
- # random (1)
- # releases (1)
- # remote-jobs (7)
- # shadow-cljs (18)
- # specter (1)
- # sql (8)
Hi! Does kondo not support the transducer arities? Here it complains
> clojure.core/map is called with 1 arg but expects 2, 3, 4 or moreclj-kondo(invalid-arity)
Code: (into [] (map :val) [{:val 1}])
Searching for "transduce[r] in issues yield nothing. (Kondo v. 2021.09.25)
@U0522TWDA Can you try on the command linting only that example? It could be a hiccup in your editor or so
yes, I am using Calva, perhaps it is doing something weird there
yes, CLI is ok
is it possible to exclude some linters from clj-kondo for a whole namespace but via config?
but I'd like to do that via config, not commenting on the code as this config is shared for a lot of projects
something like:
{:unused-namespace {:exclude-ns [user]}
:unused-referred-var {:exclude-ns [user]}}
not supported right now. I think there are various ways to go about this. we could e.g. also support {:ns-config {user {:unused-namespace {...}}}
hum, instead of configuring for each linter, kind of configure which linters you want exclude for a ns?
no I mean: this would allow you to provide an ns-local config without touching the code
i was referring to supress linter via code with {:clj-kondo/ignore}
but yeah, your idea would allow do more than just supress lint
so instead of changing each linter to support an ns, we could support providing configs per ns
btw this use case is quite rare. I'd like to discuss with you why you would like to suppress unused namespaces only in certain namespaces
it's actually quite simple, at nubank we have a service template that all services follow, for example the user ns has only this:
(ns user
(:require [clojure.tools.namespace.repl :refer [refresh refresh-all]]
[common-core.misc :as misc]))
yes, with :clj-kondo/config
in metadata you can do this for specific namespaces in your template
we probably wouldn't want to exclude linters for other namespaces, but configure custom linters for other namespaces via this new config flag specific for some namespaces would be cool
but for now, just having a way to exclude some linters for a namespace via config is quite enough
so I think if you have a template, just add the config to the template, like:
(ns user {:clj-kondo/config '{:linters {:unused-namespace {:level :off}}}})
yes, that would work for new services, but other hundreds of old services we would need to do some kind of migration 😅
something like {:config-paths ["nubank/codestyle"]}
which has all the common configuration for clj-kondo and etc
so the idea is: we should support the namespace local config (override) but outside the scode
is this a known issue, where clj-kondo doesn't see this var being set? https://github.com/metosin/ring-http-response/blob/master/src/ring/util/http_response.clj#L1177-L1180