This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-25
Channels
- # babashka (65)
- # beginners (34)
- # biff (18)
- # calva (8)
- # clara (22)
- # clj-kondo (32)
- # clojure (24)
- # clojure-bay-area (4)
- # clojure-europe (135)
- # clojure-nl (3)
- # clojure-norway (9)
- # clojure-uk (1)
- # clojurescript (11)
- # clojutre (1)
- # core-async (8)
- # cursive (3)
- # datomic (31)
- # emacs (5)
- # fulcro (6)
- # graalvm (5)
- # graphql (3)
- # honeysql (1)
- # introduce-yourself (9)
- # kaocha (1)
- # lsp (65)
- # meander (5)
- # nbb (7)
- # nrepl (2)
- # off-topic (44)
- # rum (3)
- # shadow-cljs (23)
- # specter (1)
- # tools-deps (6)
- # vim (3)
- # xtdb (30)
clj-kondo complains about an unresolved symbol in s/def
. Same works perfect with s/fdef
. What a recommended way to resolve it?
yeah, a keyword works, but with a symbol it’s also a valid expression. We use it to refer to the same spec for a fn in few places.
I have a dep management issue when running lein-clj-kondo on a particularly contrived project. These are the relevant bits:
Syntax error compiling at (clojure/tools/reader/edn.clj:1:1).
at clojure.lang.Compiler.load(Compiler.java:7652)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6856.invoke(core.clj:6115)
at clojure.core$load.invokeStatic(core.clj:6114)
at clojure.core$load.doInvoke(core.clj:6098)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5897)
at clojure.core$load_one.invoke(core.clj:5892)
at clojure.core$load_lib$fn__6796.invoke(core.clj:5937)
at clojure.core$load_lib.invokeStatic(core.clj:5936)
at clojure.core$load_lib.doInvoke(core.clj:5917)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$load_libs.invokeStatic(core.clj:5974)
at clojure.core$load_libs.doInvoke(core.clj:5958)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$require.invokeStatic(core.clj:5996)
at clojure.core$require.doInvoke(core.clj:5996)
at clojure.lang.RestFn.invoke(RestFn.java:619)
at edamame.impl.parser$eval12811$loading__6737__auto____12812.invoke(parser.cljc:1)
at edamame.impl.parser$eval12811.invokeStatic(parser.cljc:1)
at edamame.impl.parser$eval12811.invoke(parser.cljc:1)
...
Caused by: java.lang.IllegalAccessError: reader-error does not exist
at clojure.core$refer.invokeStatic(core.clj:4237)
I tried bumping tools.reader to no avail. Does it ring a bell?
(doesn't look too hard - will keep trying in the meantime!)this might be a tools.reader version conflict with the version aot'ed into clojurescript
it does now
but it didn't in older versions
What could also be the case is that an older tools reader is pulled in than what edamame depends on https://github.com/clojure/tools.reader/blob/d721510c37eb4d28247dd90c07c3c9a7dc3820ed/src/main/cljs/cljs/tools/reader/impl/errors.cljs#L39
although the clojurescript bump thing was a good lead (and something I'll try to keep in my head) finally it was a matter of adding this exclusion:
[lein-asset-minifier "0.4.6" :exclusions [org.clojure/tools.reader]]
legacy projects / plugins. 🌀
any interest in a linter that checks for (-> some-obj (. interopCall) (. interopCall2) (. interopCall3))
? It would look for thread-first macros that all have interop calls and suggest using (.. some-obj (interopCall) (interopCall2) (interopCall3))
instead
heh I started work on that last night but don't have much free time at the moment.
silly observation but -> is so perfect :star-struck:
there's also (-> some-obj .interopCall .interopCall2 .interopCall3)
I'd like the versatility of -> - for misc ops, interop, data access, math sometimes.
All with the same keystrokes (I have a life-changing snippet that expands -
to (-> $1)
I prefer to be consistent in these kidns of things, and like nesting a do block inside of a when, seems like "use the semantically correct tool"
do
is different, a redundant do clears up nesting and thus noise, but ->
vs ..
doesn't reduce any noise imo
Sure. If you don't want it, then I won't open an issue for it.
Have you thought about qualifying/namespacing the linter keywords? :style/consistent-alias
, :lint/loop-without-recur
, :syntax/duplicate-map-key
, :performance/redundant-fn-wrapper
etc
On the one hand, it would require some sort of "conversion" step to maintain backwards compatibility, but on the other hand, it would make space for things like "disable all style linters" and increase the meaning of each linter name
Well, I'm willing to help if you decide to go for it