This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-01
Channels
- # announcements (21)
- # architecture (6)
- # aws (18)
- # babashka (14)
- # beginners (231)
- # boot (1)
- # calva (2)
- # chlorine-clover (22)
- # cider (34)
- # clara (16)
- # clj-kondo (53)
- # cljdoc (5)
- # cljs-dev (22)
- # cljsrn (3)
- # clojure (283)
- # clojure-europe (24)
- # clojure-italy (9)
- # clojure-nl (5)
- # clojure-spec (5)
- # clojure-uk (57)
- # clojurescript (14)
- # core-typed (8)
- # cursive (4)
- # data-science (11)
- # datomic (41)
- # docker (24)
- # duct (2)
- # emacs (2)
- # exercism (29)
- # fulcro (96)
- # graalvm (4)
- # jobs-discuss (1)
- # kaocha (53)
- # lambdaisland (20)
- # malli (5)
- # nrepl (4)
- # observability (7)
- # off-topic (40)
- # pathom (44)
- # pedestal (8)
- # re-frame (19)
- # shadow-cljs (58)
- # spacemacs (2)
- # sql (9)
- # tools-deps (15)
- # vim (3)
- # yada (10)
Morning, I’ve raised above mentioned PR.
I don’t quite understand why (get-in (from-cache-1 nil :clj 'clojure.core) ['defn])
would be a false positive?
Also now I am not sure if I should comment here or on the PR 😄
@jakob.durstberger As for the suggestion: use (:foo ...)
or (get x :foo)
instead: maybe we shouldn't be doing that, since that may be stretching it: there are often multiple ways to get something out of something
Yeah, I think it leads down a brittle path as we would also have to add suggestions for assoc-in
and update-in
.
I am currently looking into adding those.
About it being on or off by default. I have no strong opinions. Another option would be to make it :info
instead of :warning
Sounds good to me
@jakob.durstberger Made 3 small remarks to the code.
Awesome, thank you. I’ll address these later today
And I also just realised that I haven’t added the linter to the docs yet
does anyone have tips for slingshot and it’s try+ macro? getting errors on unknown symbols
@chadhs Have you tried https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#exclude-unresolved-symbols-from-being-reported ?
{:linters {:unresolved-symbol {:exclude [(slingshot.slingshot/try+)]}}}
this did the trick 🙂
i didn’t want to do that wholesale, but being able to target just one function is perfecto 👌
Do you have a link to that?
Thank you
I noticed that there is a :exclude-destructured-keys-in-fn-args
to tweak the behavior of :unused-bindings
, would you be amenable to adding a :exclude-fn-args
that would not report on fn args at all?
the underscores are not popular, unfortunately (among the others that also work on the codebase I'm hacking on)
_foo
is idiomatic Clojure for "this is not used" so maybe an opportunity to "educate" the others? 🙂
@nate You can slap your colleagues around the head with the Clojure style guide: https://guide.clojure.style/#underscore-for-unused-bindings
Hahaha. Thanks for the link. Unfortunately, they are remote from me, so I'll have to ask them to print out a copy and slap themselves.
If I configure
:lint-as {expectations.clojure.test/defexpect clojure.test/deftest}
I would not expect to get a "missing docstring" warning on (defexpect foo ...)
because I don't get that warning on (deftest foo ...)
-- am I misunderstanding how "alike" the :lint-as
makes things?was hoping to be able to configure clj-kondo to still help me with my unused let bindings, perhaps a :only-let
modifier then
@seancorfield That could be an issue in the missing docstring linter.
@seancorfield The test for deftest is done here: https://github.com/borkdude/clj-kondo/blob/0fd662f207c8a6dd59f9473c88c7978e0a4c8e03/src/clj_kondo/impl/namespace.clj#L154
Oh, so it doesn't respect :lint-as
relationships at all... fair enough.
yeah, lint as is more or less "analyze it with the syntax of this other thing", but it's a bit ambigious if we should treat everything in the linting as that other thing maybe
I guess it makes sense in the context of the missing docstring linter to treat it as a test and skip the warning
When I get time, I'll see if there are other "special cases" where this sort of thing might crop up. Perhaps some sort of generic "symbol should be treated like one of these (set of symbols)" machinery can be added that would make this sort of thing easier in future...
That is cheating! And it also means that any regular function with :test
Metadata will not get checked for a doc string.
I hadn't thought of the case that some people use :test
metadata on their regular functions, but some do
Using with-test
or simply adding :test
metadata is more common than I thought -- it has cropped up in several discussions here around testing and REPL-driven development recently 😸
Nice! Thank you!