This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-08
Channels
- # announcements (2)
- # babashka (100)
- # beginners (25)
- # biff (7)
- # calva (13)
- # cider (24)
- # clj-kondo (39)
- # cljsrn (2)
- # clojure (22)
- # clojure-dev (13)
- # clojure-europe (12)
- # clojure-gamedev (3)
- # clojure-losangeles (2)
- # clojure-nl (1)
- # clojure-norway (3)
- # clojure-spec (11)
- # clojure-uk (2)
- # clojurescript (20)
- # core-async (8)
- # cursive (7)
- # data-science (2)
- # datomic (14)
- # emacs (6)
- # events (7)
- # fulcro (9)
- # honeysql (1)
- # kaocha (24)
- # lambdaisland (3)
- # leiningen (6)
- # lsp (30)
- # membrane (7)
- # missionary (10)
- # nbb (48)
- # nextjournal (13)
- # off-topic (6)
- # parinfer (4)
- # pathom (1)
- # polylith (1)
- # reagent (7)
- # rewrite-clj (6)
- # ring (11)
- # sci (7)
- # shadow-cljs (8)
- # sql (13)
I just ran into a bug where I had (:require [example.company.common :as ecc])
and then later wrote :ecc/some-keyword
, and was getting an error because I only used a single colon and the keyword didn't autoresolve to the right namespace. Would you be interested in a linter that checks qualified keywords that share a namespace with an existing namespace alias but aren't auto-resolving?
This is an interesting one. Using it like you wrote is perfectly valid but it can help find these typos. Would keep it at warning level for sure. And it should not only cover keywords but symbols and destructuring as well IMO
are there auto-resolving symbols?
I haven't made many mistakes that I can remember with this I actually saw a counter-example today:
(require '[sci.core :as sci])
:sci/error
A bit on the fence about this one, but let's see how others feel about it.yeah, i suspected this wouldn't be a sure-fire lint lol
If included, I would want it off by default
If you want to configure a :lint-as
for a macro in a single namespace, is the best option using namespace metadata? Is there any way to avoid using the fully qualified symbol?
{:clj-kondo/config '{:lint-as {shared-lib.asset-caching-test/with-test-file clj-kondo.lint-as/def-catch-all}}}
To clarify, it’s a macro defined in the same namespace
(ns shared-lib.asset-caching-test
{:clj-kondo/config '{:lint-as {shared-lib.asset-caching-test/with-test-file clj-kondo.lint-as/def-catch-all}}}}
it’s pretty minor, just wondering if there was a way since it seems like it’s possible with other config options like :exclude
Is it possible to disable type-mismatch
in the body of a macro? For example: (korma.core/where (< :start_date start-date)
Currently not, but a #_:clj-kondo/ignore
before the form should work. A hook would be a better solution here probably
Nice! That worked. I wasn’t aware of :config-in-call
and I don’t see it documented in the config README, is this new?
We should document that. If you can post an issue and/or a PR, that would be helpful
Still getting a hang of the configuration. Currently using
:config-in-call {korma.core/where {:linters {:type-mismatch {:level :off}}}}
I’m curious if there’s a way to be more specific to functions like <
?I meant is there a way to only disable :type-mismatch
for <
instead of for everything (in the context of the korma.core/where
call)
I’m perfectly happy with using {:level :off}
and I see the “types” config is still WIP so I think I’ll leave it.
I think in this case, writing a hook for some of those korma macros would be the best solution
Yeah. If that was to happen would it make most sense to PR that into clj-kondo/config
?