This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-16
Channels
- # announcements (18)
- # architecture (12)
- # babashka (20)
- # beginners (32)
- # biff (21)
- # calva (81)
- # clerk (6)
- # clj-kondo (16)
- # clj-otel (5)
- # cljsrn (8)
- # clojure (94)
- # clojure-austin (1)
- # clojure-australia (1)
- # clojure-europe (68)
- # clojure-nl (2)
- # clojure-norway (6)
- # clojure-uk (2)
- # clojurescript (13)
- # conjure (1)
- # core-logic (1)
- # cursive (7)
- # data-science (2)
- # datahike (3)
- # datomic (12)
- # emacs (33)
- # etaoin (1)
- # fulcro (8)
- # graalvm (2)
- # graphql (1)
- # honeysql (1)
- # hyperfiddle (97)
- # improve-getting-started (40)
- # jobs (2)
- # jobs-discuss (12)
- # lsp (9)
- # membrane (6)
- # nbb (2)
- # off-topic (16)
- # portal (6)
- # re-frame (2)
- # reagent (3)
- # releases (2)
- # remote-jobs (1)
- # tools-deps (7)
- # xtdb (38)
Question about writing custom hooks: Is there some way to take a symbol/token node and get the fully-qualified version of a symbol that is using a namespace alias?
Motivating example: I'm working on a custom linter that will complain if you use certain forms e.g. with-redefs
inside parallel tests (we're using a test runner that supports parallel tests). I have it working where it can walk the node and find the symbol with-redefs
and error, but it doesn't detect situations if you do something like
(ns my-ns
(:require [clojure.core :as core]))
(deftest ^:parallel my-test
(core/with-redefs [...]
...))
I would like the hook to be able to take a with-redefs
token node or core/with-redefs
token node and figure out that in this namespace it's referring to clojure.core/with-redefs
.
I could figure this out myself if I had access to ns-aliases
or something for the namespace being lintedHi 👋, with clj-kondo v2023.01.20
I’m seeing unsupported binding form m/scan
(`m` is for meander
) being classified as an error
is there a way to exclude m/scan
etc from this check (couldn’t find :unsuported-binding-form
linter), or is there some other config parameter I should be looking at?
Thanks
@U7MHWDLD8 Can you provide some more info, e.g. a code snippet in which this occurs?
This would be a simple example
(m/search images-data
(m/scan
{::url ?url})
{:something/uri (make-uri-entity ?url)})
:face_palm: It was this:
{:lint-as {,,,
meander.epsilon/match clojure.core.match/match
meander.epsilon/search clojure.core.match/match
,,,}}
All is good in the world again, thank you @U04V15CAJ
Release coming tomorrow with a substantial list of new things and improvements: https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#unreleased Please try it out from master, if you're able to. Here is how you can run clojure-lsp + clj-kondo from master: https://github.com/clj-kondo/clj-kondo/issues/1995#issuecomment-1432832765