This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-15
Channels
- # announcements (2)
- # babashka (27)
- # beginners (53)
- # boot (3)
- # calva (5)
- # cider (1)
- # clj-kondo (46)
- # cljdoc (38)
- # cljs-dev (40)
- # cljsrn (1)
- # clojars (5)
- # clojure (61)
- # clojure-europe (124)
- # clojure-germany (3)
- # clojure-losangeles (6)
- # clojure-nl (12)
- # clojure-uk (11)
- # clojurescript (44)
- # clojureverse-ops (7)
- # datomic (13)
- # events (3)
- # introduce-yourself (1)
- # jackdaw (5)
- # lsp (115)
- # malli (1)
- # off-topic (16)
- # polylith (2)
- # releases (1)
- # remote-jobs (6)
- # shadow-cljs (10)
- # sql (2)
- # timbre (1)
- # tools-deps (30)
- # vim (34)
- # xtdb (20)
according to this https://github.com/clj-kondo/config/tree/master/hugsql clj-kondo should accept them if you import them from another namespace, but that seems to no longer be true
you can solve this either with :lint-as {your.cool/macro clojure.core/def}
or just disabling that linter. the point of that linter is when you use vars from another namespace that don't exist, you will get a warning.
I'm not entirely sure about the empty namespace: it's complaining about unresolved-vars from a namespace that contains just an s/fdef and the macro that generates all these vars
I know I can tell clj-kondo to ignore them, but it's a very common pattern in our codebase, and so keeping the ignore list up to date will be a lot of work
if someone else reads these messages: I've sorted out the problem using a hook that replaces the macro calls with declare/def statements
since these calls are in libraries in my case I also had to reindex the cache with clj-kondo --lint "$(lein classpath)"
Just wanted to mention that this is flagged as "missing :mvn/version, :git/url, or :local/root" although it is legal now in the latest t.d.a:
io.github.cognitect-labs/test-runner {:git/tag "v0.3.1" :git/sha "705ad25"}
what is the rule here, if there is a git/sha, what rule should the library symbol have in order for it to be resolved to github/gitlab etc?
it has to conform to ^(com|io)\.(github|gitlab)\..*$
at the moment I think
☝️:skin-tone-2: Yup, sounds right. And if it's that format, :git/url
can be omitted and the you should have :git/tag
AND :git/sha
.
need to check the actual tools deps code though, the guide on http://clojure.org only mentions github, not gitlab
if you only have git/tag will the tool then insert the SHA or...? tags can be a bit volatile
(I think there's also some wiggle room in t.d.a right now because I put {:tag ".." :sha ".."}
in one deps.edn
file and it was perfectly happy with it, to my surprise)
If you have a tag you can have a prefix sha, but if you have no tag you need a full sha
Having only :git/tag
is not allowed I think.
but you always need a :git/sha
key.
Yeah, the only exception to needing the :git/sha
with the tag is when installing a tool with -Ttools
(or just :sha
in the old format)
Like I said somewhere else, I think I want to write a tool for use with -T which allows you to specify only a tag and then it'd use rewrite-clj to add the dep to your deps.edn file with a prefix sha.
Deducing URLs from lib names: https://github.com/clojure/tools.deps.alpha/blob/master/src/main/clojure/clojure/tools/deps/alpha/extensions/git.clj#L17-L21
Yeah, a bb script would be a good way to package it to run elsewhere, but that is kinda what -T is for on this. Would probably just make it compatible with bb so that it could be run that way if a user wants.
If anyone wants to work on this, feel free. I have to write a talk this weekend so I probably won't get to it by then :)
I'd volunteer if my weekend weren't already full
Logic around what can be in git coords: https://github.com/clojure/tools.deps.alpha/blob/master/src/main/clojure/clojure/tools/deps/alpha/extensions/git.clj#L56-L76 -- :tag
and :sha
are supported but :git/tag
and :git/sha
are "preferred" it seems (and you can't have both the qualified and unqualified versions).
(and I doubt this is urgent for anyone b/c very few folks are going to be a) running the very latest t.d.a and b) using the new, shorter git coords 🙂 )