qa

Call out for QA, testing new features in Clojure projects
borkdude 2019-09-14T10:13:59.000200Z

I implemented some local type checking / inference in clj-kondo. Any volunteers for testing? demo: https://twitter.com/borkdude/status/1172628472273035265 You can test by checking out https://github.com/borkdude/clj-kondo at the typing branch and lint random code using:

clojure -A:clj-kondo --lint <your-code> | grep Expected
The grep takes care of only displaying the type errors that clj-kondo found. Please report any false positives you may find in the smallest repro possible.

borkdude 2019-09-14T10:17:54.000700Z

Issue where you might report findings: https://github.com/borkdude/clj-kondo/issues/445

2019-09-14T10:19:50.001200Z

is it the typing branch?

borkdude 2019-09-14T10:21:18.001600Z

sorry, yes. updated

2019-09-14T10:21:31.001800Z

np, building now 🙂

2019-09-14T10:26:26.002500Z

i tried running it against clojure's source and i see some errors under the test directory -- should i report those?

borkdude 2019-09-14T10:31:52.002900Z

Sure, if they are relevant

2019-09-14T10:33:24.003100Z

lol, how would i know, i wonder 🙂

borkdude 2019-09-14T10:33:53.004100Z

What does the error message say for example?

2019-09-14T10:34:42.004300Z

clojure/test/clojure/test_clojure/data_structures.clj:1130:44: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/logic.clj:109:14: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:110:16: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:173:49: error: Expected: seqable collection, received: positive integer.
clojure/test/clojure/test_clojure/sequences.clj:175:13: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:176:15: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:178:14: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:822:14: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/serialization.clj:55:13: error: Expected: seqable collection, received: nil.

2019-09-14T10:35:15.004700Z

i ran it with tools.reader and got an exception -- should i report that?

2019-09-14T10:35:32.004900Z

java.lang.IllegalArgumentException: No matching clause: [:clj :edn]

2019-09-14T10:36:29.006300Z

no, that's probably pebkac

2019-09-14T10:36:40.006700Z

i probably gave a bad path

borkdude 2019-09-14T10:36:49.007Z

Seems relevant :-). Just one of those nil examples should be fine, would be nice if you could get it down to a small example

2019-09-14T10:37:13.007700Z

will have a look at least

borkdude 2019-09-14T10:37:16.007800Z

Or just post the permalink to the core, also fine

borkdude 2019-09-14T10:37:20.008Z

Code of the failing example I mean

2019-09-14T10:45:13.008800Z

i think it's in here:

(deftest ordered-collection-equality-test
  (let [empty-colls [ []
                      '()
                      (lazy-seq)
                      clojure.lang.PersistentQueue/EMPTY
                      (vector-of :long) ]]
    (doseq [c1 empty-colls, c2 empty-colls]
      (is-same-collection c1 c2)))
  (let [colls1 [ [-3 :a "7th"]
                 '(-3 :a "7th")
                 (lazy-seq (cons -3
                   (lazy-seq (cons :a
                     (lazy-seq (cons "7th" nil)))))) ; <-------- this line is 1130
                 (into clojure.lang.PersistentQueue/EMPTY
                       [-3 :a "7th"])
                 (sequence (map identity) [-3 :a "7th"]) ]]
    (doseq [c1 colls1, c2 colls1]
      (is-same-collection c1 c2)))
  (is-same-collection [-3 1 7] (vector-of :long -3 1 7)))

borkdude 2019-09-14T10:46:11.009400Z

AFK for a bit, I’ll check it out later

2019-09-14T10:46:17.009600Z

sounds good

borkdude 2019-09-14T12:41:17.009900Z

@sogaiu both problems fixed

borkdude 2019-09-14T12:41:25.010100Z

nil is also seqable, so that's right

2019-09-14T12:43:01.010300Z

cool!