This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-27
Channels
- # announcements (47)
- # babashka (36)
- # beginners (7)
- # biff (34)
- # calva (9)
- # cider (5)
- # clj-http (13)
- # clj-kondo (24)
- # cljs-dev (9)
- # clojure (146)
- # clojure-austin (1)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (8)
- # clojure-uk (2)
- # clojurescript (4)
- # clr (1)
- # core-async (9)
- # cursive (11)
- # datomic (6)
- # emacs (17)
- # events (3)
- # fulcro (45)
- # graphql (7)
- # helix (1)
- # hyperfiddle (28)
- # java (1)
- # london-clojurians (1)
- # lsp (75)
- # malli (1)
- # membrane (35)
- # reitit (6)
- # releases (1)
- # shadow-cljs (48)
- # tools-build (5)
- # tools-deps (27)
I'm writing code using the https://github.com/rm-hull/infix library, for a module with heavy mathematical content. For a simple example, consider:
(infix bpm0 * (1 + percent-bpm-change))
this yields the warning: a number is not a function [not-a-function]
. I tried to edit the clj-kondo config.edn
like:
{:linters {:not-a-function {:exclude [(infix.macros/infix)]}}}
but I can't get the warning to go away. What am I missing?Can you try:
:config-in-call {library/infix {:linters {:not-a-function {:level :off}}}}
Yes thank you @U04V15CAJ that immediately fixed the issue! I'll look :config-in-call
in the documentation, if you have pointers feel free to share! 🙂
Hello 👋
I’m seeing clj-kondo v2023.01.20
reporting issues with re-frame layer 3 subscriptions (taking other subs as input) in the presence of :rename
.
It’s something I’ve not seen in previous versions
What’s interesting if I just :rename
that one thing [reg-sub sub]
it seems to be OK with that 😉
Doesn't ring a bell. Feel free to provide an issue + repro, preferably something that I can just copy/paste into my editor with the full namespace form
#expectations’s expectations.clojure.test/defexpect
can do a short-circuit check, where if a name symbol and two forms, wraps the two forms in an (expect)
call. So you can write (defexpect some-func-test :ret-val (some-func))
and it will work like a normal (deftest some-func-test (is (= :ret-val (some-func))))
. However, if you want to test against a string and you have :lint-as {expectations.clojure.test/defexpect clojure.test/deftest}
, then clj-kondo throws a warning/error saying "misplaced docstring", even tho clojure.test/deftest
doesn't accept a docstring either. is this worth a github issue or is there a smarter way to lint defexpect
calls?
:config-in-call {foo/defexpect {:linters {:missing-docstring {:level :off}}}}
is maybe a good workaround@UEENNMX0T Can you add that as an example to https://github.com/clojure-expectations/clojure-test/issues/29 so I can provide better hooks for that library?
I can't really repro your problem @UEENNMX0T
(ns foo
{:clj-kondo/config '{:linters {:missing-docstring {:level :warning}}
:lint-as {foo/deftest clojure.test/deftest}}})
(defmacro deftest "docs" [& _args])
(deftest foo)
I don't see a warning for a missing docstring for foo
thereminimal reproduction
one might say it's an unused value, but it's not a docstring:
(meta #'docstring-error)
; {:test #function[noahtheduke.spat-test/fn--24046],
; :line 373,
; :column 1,
; :file "/home/noah/personal/spat/test/noahtheduke/spat_test.clj",
; :name docstring-error,
; :ns #namespace[noahtheduke.spat-test]}
Ah I see, :misplaced-docstring
. Yeah, I think that should never happen in deftest
:)
I gave it a go but it relies on analyze-defn
and I couldn't figure out how to wrap the body without triggering other linting errors lol (like a do
or a let
block)
@UEENNMX0T I think misplaced docstring should only be emitted when the resolved-var is defn, not when it's deftest
ah, so check for :test
metadata in analyze-defn
?