Fork me on GitHub
#clj-kondo
<
2020-01-01
>
Duck Nebuchadnezzar15:01:34

clj-kondo is failing to ignore the symbol in a devcards.core/deftest form, but cljs.test/deftest works fine and :lint-as {devcards.core/deftest cljs.test/deftest} doesn't seem to do it. Any ideas?

borkdude15:01:27

Can you provide a small reproducable snippet in the form:

$ clj-kondo --config '{:lint-as ...}' --lint - <<< '(ns foo (:require [devcards.core :as dc])) (dc/deftest ...))'
and show me what the current (undesired) behavior is?

Duck Nebuchadnezzar15:01:40

clj-kondo --config '{:lint-as {devcards.core/deftest cljs.core/deftest}}' --lint - <<< '(ns foo (:require [cljs.test :refer-macros [is]] [devcards.core :refer-macros [deftest]])) (deftest main-test (is (= 1 1)))'

Duck Nebuchadnezzar15:01:09

I want the error about main-test silenced

borkdude15:01:18

that's weird yes, I have a similar situation with spartan.test which I tested yesterday and worked fine: https://github.com/borkdude/spartan.spec/blob/master/.clj-kondo/config.edn I'll look into it

Duck Nebuchadnezzar15:01:15

defcard-rg fails too, but I figured if I could solve one, I could solve the other

borkdude15:01:39

yeah, it's weird. give me a moment to figure it out

👍 4
borkdude15:01:02

hmm, this works:

clj-kondo --config '{:lint-as {spartan.test/deftest clojure.test/deftest}}' --lint - <<< '(ns foo (:require [spartan.test :refer [deftest]])) (deftest main-test)'

borkdude15:01:03

this also works:

clj-kondo --config '{:lint-as {devcards/deftest clojure.test/deftest}}' --lint - <<< '(ns foo (:require [devcards :refer [deftest]])) (deftest main-test)'

borkdude15:01:28

this also works:

clj-kondo --config '{:lint-as {devcards.core/deftest clojure.test/deftest}}' --lint - <<< '(ns foo (:require [devcards.core :refer [deftest]])) (deftest main-test)'

borkdude15:01:05

aaand this also works:

clj-kondo --config '{:lint-as {devcards.core/deftest cljs.test/deftest}}' --lint - <<< '(ns foo (:require [devcards.core :refer-macros [deftest]])) (deftest main-test)'

borkdude15:01:56

and this also works:

clj-kondo --config '{:lint-as {devcards.core/deftest cljs.test/deftest}}' --lint - <<< '(ns foo (:require [cljs.test :refer-macros [is]] [devcards.core :refer-macros [deftest]])) (deftest main-test (is true))'
^ @duck

borkdude15:01:12

Not sure what the difference is, maybe a weird typo somewhere?

Duck Nebuchadnezzar15:01:36

that one does indeed pass for me

borkdude15:01:56

ah, cljs.core instead of cljs.test

borkdude15:01:40

@duck Were you the same person asking me about orchestra/defn-spec? I'm thinking about a solution like this: https://github.com/borkdude/clj-kondo/issues/682

Duck Nebuchadnezzar15:01:45

The only difference is forms inside is

borkdude15:01:07

The difference is cljs.core instead of cljs.test

borkdude15:01:26

There is no cljs.core/deftest

borkdude20:01:09

(not sure if you read this)