Am I missing something obvious for treating code as data and interrogating it? The code is all Clojurescript. I've been playing with clj-rewrite. What I really want is to write scripts which analyse my source code - looking for undesirable code patterns, estimating complexity, priporitising testing effort on usage, KPIs around prepost use, it goes on... Reading is non trivial because of read macros. So clj-rewrite is nice. Then it gets fiddly because of needing to resolve aliases (manually got around the worst of this by parsing the ns forms). Feels like a script which reads, resolves and shoves everything into a datascript db would be good. I think perhaps that's what clj-kondo used to do but perhaps that changed. Haven't tried edamame yet.
@olivergeorge you might be interested in taking advantage of https://github.com/clj-kondo/clj-kondo/tree/master/analysis.
Thanks. I got the impression that's more limited in scope but I'll look again.
Well, clj-kondo uses rewrite-clj to read Clojure. But then it interprets it for the purposes of linting. You get access to those interpretations via data analysis.
There’s a chance it might not meet your requirements, but probably worth another look-see.
It does generate lots of useful data.
Take a look at grasp as well (Google borkdude grasp)
On the phone so I can't paste link
Thanks @borkdude I was having a great time with that this morning. Was able to do things like "find maps with a specific key where the value is missing something". Worked like a charm with very little code. Brilliant stuff.
What is it using under the hood? The deps didn't reveal much.
It's using spec under the hood :)
And SCI, but only for resolving var names, not really for anything fancy
Nice. And Sci, in turn, uses edamame.
Yes