This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (3)
- # babashka (23)
- # beginners (54)
- # calva (9)
- # cider (8)
- # clj-kondo (18)
- # cljsrn (25)
- # clojure (69)
- # clojure-australia (1)
- # clojure-europe (7)
- # clojure-spec (13)
- # clojure-uk (1)
- # clojurescript (122)
- # conjure (8)
- # cursive (15)
- # defnpodcast (9)
- # deps-new (2)
- # emacs (22)
- # fulcro (10)
- # graalvm (36)
- # luminus (5)
- # meander (5)
- # minimallist (1)
- # observability (6)
- # off-topic (54)
- # reagent (8)
- # reitit (2)
- # releases (1)
- # reveal (25)
- # shadow-cljs (21)
- # tools-deps (50)
- # vrac (1)
- # xtdb (2)
@borkdude there is a construct in libpython-clj which appears to make certain namespaces / aliases available. it is called
after it is evaluated, 7 namespaces / aliases become available.
do you have a recommendation as to how to teach clj-kondo about this construct using hooks?
for starters i tried constructing a
do form containing a
require form, but i'm getting the sense that may not work.
@borkdude i see that that works in an editor, thanks. i tried with:
but that doesn't seem to work in my editor. how do i construct a quoted form (i.e. using single quote) using the hooks api? i thought i might need to use rewrite-clj's quote-node but that doesn't appear to be in the hooks api. may be there is another way?
(comment (require (quote python.list))) (python.list/hi)
Hmm, clj-kondo's handling of require might not understand that currently. That's something to fix. But since you are writing a hook, this won't be emitted top level anyway?
i think the typical place to use it is at top level, but doesn't the hooks api only let us return one node?
this is very co-incidental: I fixed a similar thing in sci recently: macros emitting top-level dos
I think there's two things to post issues for:
- clj-kondo should handle requires in top-level dos
- clj-kondo should handle require with
yeah please. I'm about to start a new 2 week Clojurists Together cycle for clj-kondo :)
Sophisticated CI script using babashka and clj-kondo in Gitlab: https://gist.github.com/hansbugge/4be701d771057e8ef6bbbb0912656355