Fork me on GitHub
#clj-kondo
<
2021-10-26
>
nodename05:10:30

Hi, I haven’t used clj-kondo before but I’d like to use the re-frame analyzer by @roman01la https://gist.github.com/roman01la/c6a2e4db8d74f89789292002794a7142. Is that gist supposed to be a standalone clj program? How would I compile or invoke it?

borkdude07:10:56

I recommend looking at the repo I just posted by @yannvahalewyn which contains more explanation

nodename17:10:30

Yes, I’m now looking at that repo and unfortunately I know nothing about the cli tools. I’ve tried running it as clj -M scripts/lint.clj but that doesn’t print out the expected output

nodename17:10:07

Obviously I’m doing something wrong because even a (println "Hello") in main doesn’t show up

borkdude19:10:05

linting the source doesn't execute it

yannvahalewyn20:10:15

@U04V91K02 I'll add some more explicit steps to the docs!

yannvahalewyn20:10:15

I've made the docs much more explicit, have a look and see if that helps you out!

nodename17:10:58

How do I run this script?

yannvahalewyn20:10:04

You can copy it over in your own repo and just call the main function yourself. It's meant to be copied over and tweaked since lot's of things are hardcoded (such as src paths etc..). Alternatively there's a short section on how to use it from babashka. Not very in depth, could it use some more documentation?

yannvahalewyn20:10:11

Since multiple people are asking questions I'm adding some explicit steps to the docs.

yannvahalewyn20:10:52

Mentioned in the other thread as well but the docs now offer explicit steps on how to get it running!

yannvahalewyn20:10:52
replied to a thread:

Mentioned in the other thread as well but the docs now offer explicit steps on how to get it running!

nodename20:10:29

@yannvahalewyn % clj -M -m analyse-re-frame Execution error at clojure.main/main (main.java:40). No namespace: analyse-re-frame found

yannvahalewyn20:10:32

Hmm let me see, works fine for me

yannvahalewyn20:10:57

Some silly things, are you in the correct directory? Did you pull the latest version of the repo? (I renamed that NS in the last commit)

yannvahalewyn20:10:51

Make sure you see :paths ... "scripts" in the deps.edn and there is a scripts/analyse_re_frame.clj file.

nodename20:10:54

Yes, I am in the analyse-re-frame-usage-with-clj-kondo directory and pulled. scripts/analyse_re_frame.clj exists

nodename20:10:46

Oh the file says (ns lint) !!

yannvahalewyn20:10:14

Oh that's my bad, late day and I didn't commit the ns declaration since I was testing the babashka stuff

yannvahalewyn20:10:33

I'll push an update but you could replace it yourself and it should work :thumbsup:

nodename20:10:45

I have received output! Thanks!

Joshua Suskalo22:10:29

Hey, so the duplicate-map-key linter might need some work. I currently have a monotonically increasing key generation function, kinda like gensym, and calling that function multiple times as keys is guaranteed to be valid, but clj-kondo marks it as duplicates.

Joshua Suskalo22:10:56

Is it intended that calling a no-args function multiple times is treated as an identical key to itself?

Joshua Suskalo22:10:00

this is unexpected

Joshua Suskalo22:10:15

It actually is invalid, because the reader breaks.