Fork me on GitHub
#clj-kondo
<
2021-08-22
>
genRaiy12:08:52

@borkdude I'm trying to grok the analysis data

genRaiy12:08:56

given this input

genRaiy12:08:02

(ns bar
  (:require [foo :refer [xx]]))

(defn yy [x] (xx x))

(yy 2)

genRaiy12:08:07

I get back

genRaiy12:08:03

{:namespace-definitions
 [{:filename "<stdin>",
   :row 1,
   :col 1,
   :name bar,
   :name-row 1,
   :name-col 5,
   :name-end-row 1,
   :name-end-col 8}],
 :namespace-usages
 [{:name-end-col 17,
   :name-end-row 2,
   :name-row 2,
   :alias-end-row nil,
   :alias-row nil,
   :filename "<stdin>",
   :from bar,
   :col 14,
   :name-col 14,
   :alias-col nil,
   :alias-end-col nil,
   :row 2,
   :to foo}],
 :var-definitions
 [{:fixed-arities #{1},
   :end-row 4,
   :name-end-col 9,
   :name-end-row 4,
   :name-row 4,
   :ns bar,
   :name yy,
   :defined-by "clojure.core/defn",
   :filename "<stdin>",
   :col 1,
   :name-col 7,
   :end-col 21,
   :row 4}],
 :var-usages
 [{:name-end-col 28,
   :name-end-row 2,
   :name-row 2,
   :name xx,
   :filename "<stdin>",
   :from bar,
   :col 26,
   :name-col 26,
   :row 2,
   :to foo}
  {:name-end-col 17,
   :name-end-row 4,
   :name-row 4,
   :name xx,
   :filename "<stdin>",
   :from bar,
   :col 15,
   :name-col 15,
   :from-var yy,
   :arity 1,
   :row 4,
   :to foo}
  {:name-end-col 6,
   :name-end-row 4,
   :name-row 4,
   :name defn,
   :filename "<stdin>",
   :from bar,
   :macro true,
   :col 2,
   :name-col 2,
   :arity 3,
   :varargs-min-arity 2,
   :row 4,
   :to "clojure.core"}
  {:fixed-arities #{1},
   :name-end-col 4,
   :name-end-row 6,
   :name-row 6,
   :name yy,
   :filename "<stdin>",
   :from bar,
   :col 2,
   :name-col 2,
   :arity 1,
   :row 6,
   :to bar}]}

genRaiy12:08:08

I can't trace the definition of xx used in the function yy back to the foo ns

genRaiy12:08:11

the :from and :to seem inverted ... but of course I could be reading it wrong 🙂

borkdude12:08:42

The usage goes from ns A to the ns B, it just depends on how you look at this

borkdude12:08:16

The reference is in ns A (from), the source is in ns B (to)

genRaiy15:08:56

ok, I can get it to work ... I'll hold the telescope the other way 🙂

genRaiy15:08:06

my intuition is different - maybe it will change

borkdude15:08:26

I would say it's better to get over it, it won't change anyway ;)

😝 2
borkdude15:08:49

like all bad names in clojure, once they are there, you can't change them

genRaiy18:08:04

lol I actually meant my intuition rather than the words

borkdude18:08:45

yes, I understood that

borkdude18:08:25

but I can now see how that was confusing :)

genRaiy18:08:53

I appreciate your sympathy!

simonkatz16:08:13

I’ve come across an issue where clj-kondo is mis-reporting the file in which there are problems. There’s a minimal reproduction at https://github.com/simon-katz/bug-report-clj-kondo-misplaced-reports. The README there explains the details. I’m happy to create an issue if that would be useful.

borkdude18:08:45

That's a weird bug indeed. Please post an issue and I'll have a look soon