Fork me on GitHub
#clj-kondo
<
2019-06-11
>
borkdude15:06:49

anyone wants to test a new feature that shows unresolved symbols?

borkdude15:06:03

the main goal is to eliminate false positives 🙂

kszabo15:06:41

I would be glad to

borkdude16:06:05

@thenonameguy would you like to run with a binary (if so, linux or mac), or the clojure version (JVM)?

kszabo16:06:14

I’m using OSX, I’ve been using brew to upgrade

kszabo16:06:35

but I can probably run it through clj

borkdude16:06:21

the branch with the work in progress is called unresolved-symbols in case you want to try it with clj

borkdude16:06:59

This is the issue, in case you want to report anything: https://github.com/borkdude/clj-kondo/issues/174

kszabo16:06:49

thanks, I’ll report back. It seems to work btw, I’m just seeing false positives like deftest, I’ll probably have to create a new cache for this

borkdude16:06:17

deftest should work, but you’ll have to use :require (unless I’m not understanding correctly your false positive)

borkdude16:06:28

clj-kondo doesn’t support use just like joker 🙂

kszabo16:06:02

./test/main/atlas/s3_test.clj:8:2: error: unresolved symbol use-fixtures
./test/main/atlas/s3_test.clj:9:4: error: unresolved symbol compose-fixtures
./test/main/atlas/s3_test.clj:16:2: error: unresolved symbol deftest

kszabo16:06:33

(ns atlas.s3-test
  (:require ...
            [clojure.test :refer :all]
           ...))

(use-fixtures :once
...

borkdude16:06:41

yeah, don’t use :refer :all (effectively the same as :use)

borkdude16:06:48

I could make it work, technically, but it would be a lot more complex and at the same time, I think it make sense if we abandoned use and refer all as a community. Even more so, since ClojureScript doesn’t support it, so you’re already on your way to good .cljc if you adopt this practice.

borkdude16:06:24

I should probably document this in the “opinionated” section of clj-kondo 🙂

👍 4
borkdude16:06:10

but I was going to write a “how to ns” kind of linter, which is also will help you with this: https://stuartsierra.com/2016/clojure-how-to-ns.html

nate18:06:12

@borkdude oh interesting, I thought the :refer :all in test code was the norm, it's the only place I've seen it and allowed it in my code

nate18:06:59

I guess the alternative is to :refer what you need by name

8
dominicm20:06:09

I use refer all extensively in dev namespaces, I think the clojure.test usage is okay also, because they're globally unique. But cljs doesn't even support it so makes life hard anyway.