This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-11
Channels
- # announcements (6)
- # babashka (7)
- # beginners (145)
- # biff (2)
- # calva (9)
- # cider (4)
- # circleci (9)
- # clj-commons (22)
- # clj-kondo (26)
- # cljs-dev (70)
- # cljsrn (4)
- # clojure (46)
- # clojure-australia (9)
- # clojure-europe (62)
- # clojure-nl (5)
- # clojure-norway (4)
- # clojure-spec (11)
- # clojure-uk (3)
- # clojurescript (18)
- # copenhagen-clojurians (1)
- # core-async (1)
- # cursive (13)
- # datahike (6)
- # datomic (47)
- # emacs (5)
- # events (2)
- # fulcro (13)
- # google-cloud (2)
- # gratitude (2)
- # helix (5)
- # honeysql (5)
- # hyperfiddle (31)
- # jobs (1)
- # jobs-discuss (6)
- # london-clojurians (1)
- # lsp (5)
- # off-topic (9)
- # polylith (12)
- # portal (18)
- # re-frame (5)
- # reagent (29)
- # releases (2)
- # shadow-cljs (43)
- # specter (1)
- # test-check (8)
- # vim (1)
- # xtdb (66)
i've been writing a lot of hooks for my company's codebase and they've been great. i'm interested in writing something that checks multiple nodes at once. is that possible? are there any plans for such a thing?
For example, I'd like to be able to write a hook that operates on a whole file, to allow for writing versions of :redefined-var
.
https://clojurians.slack.com/archives/C053AK3F9/p1652285637355079 gave me inspiration but there are multiple uses that come to mind
for warn on reflection I already have an issue: if you do Java interop and that form isn't there, then warn
i could write that in something other than clojure or just not using clj-kondo, lol, but it's so dang handy
for re-defined var, this is already a linter, what would you like to do differently there?
I see no reason why we couldn't have such a hook, but trying to get more compelling reasons for it
At my job, we have separate namespaces for groups of routes using compojure.core/defroutes
. We tend to keep those at the bottom of each of their files, but sometimes extra functions or comment blocks or other things can end up below. I'd like to enforce that each defroute
expression is the final expression in a given namespace
in addition to the one about requiring (set! *warn-on-reflection* true)
below each ns
form
yeah, that's a good way to do it, actually
so there is one question that comes up with .cljc files. clj-kondo transforms such a file once for :clj and once for :cljs and then lints it
that would probably be good. then users can write (defn my-file-hook [{:keys [lang]}] (when (= :clj lang) ...))
yes! i'll write it up for you
thanks so much for being open to this idea! glad I could work through it with you
This touches on some a thing (linting .edn files) that was already in the queue for a while and I like this solution better since it's more flexible