Fork me on GitHub
#spacemacs
<
2017-11-19
>
jumar11:11:09

I use flycheck-joker and have problems with false positives related to clojure.test vars or similar ones that I require with :refer :all

(ns my-ns-test
  (:require [my-ns :as sut]
                 [clojure.test :refer :all]))

(deftest shortest-path
  (testing "ideal path"
    (is (= ...
Here the joker reports Unable to resolve symbol: deftest; also unused namespace clojure.test Does anyone know why is that and how can I fix it?

Candid23:11:26

joker doesn't work well with use or :refer :all. If you do :refer :all, any symbol becomes potentially valid in your namespace, essentially preventing symbol resolution linting completely. If you want joker to resolve symbols (and warn on unresolved ones), always list all referred vars explicitely: :refer [deftest testing is are...]

Candid23:11:30

alternatively, you can use qualified symbols:

(:require [clojure.test :as t])
(t/deftest shortest-path (t/testing ...))

jumar06:11:28

Thanks for info. I (almost) always qualify symbols with some prefix but clojure.test is kind of handy exception since I've found it noisy to prefix everything with t/