phronmophobic / dewey

Index of Clojure libraries available on github.
Eclipse Public License 1.0
76 stars 1 forks source link

Expanding the clj-kondo analysis config #4

Open sheluchin opened 1 year ago

sheluchin commented 1 year ago

Hi, @phronmophobic. Would you be open to expanding the config map which Dewey passes to clj-kondo?

My code is relying on {:var-definitions {:meta [:arglists]}} for handling some edge cases, particularly in Clojure core and the associated tests, because some of the definitions there are a little unusual. In some of the core definitions the arglist is defined only in meta and in some of the tests there are intentionally invalid definitions, and I check for empty :arglist-strs and empty :meta {:arglists ...} to remove those entries.

In general, I'm very much interested in delegating some of the data extraction requirements in my project to Dewey, but if there's a gap between my requirements and the provided data, I basically have to re-run the analysis on my end.

I guess this issue is two questions:

  1. would you be open to adding {:var-definitions {:meta [:arglists]}} to the current analysis config?
  2. do you have any thoughts about addressing such requirement gaps in general? perhaps it would be more pragmatic to ask clj-kondo for everything it is able to provide? I'm not sure if that would have other implications for performance or something else as you compile the pre-computed data sets
phronmophobic commented 1 year ago

would you be open to adding {:var-definitions {:meta [:arglists]}} to the current analysis config?

Yes!

do you have any thoughts about addressing such requirement gaps in general? perhaps it would be more pragmatic to ask clj-kondo for everything it is able to provide? I'm not sure if that would have other implications for performance or something else as you compile the pre-computed data sets

My attempt was to ask for everything clj-kondo could provide (except from linting), but it seems like I missed a few options. Generally, I would like to include as much information as possible and only omit extra analysis if some type of analysis caused a problem.

sheluchin commented 1 year ago

Thanks for explaining your rationale.

I made that :point_up: issue in clj-kondo. I think adding the option to clj-kondo and activating it here might be the best way to accomplish this. Do you think it's a reasonable approach, @phronmophobic?

phronmophobic commented 1 year ago

I think there is a place for something like :analysis :all, but I'm not sure it's a good idea for dewey. I've been working on automating more of the dewey analysis. An important goal for the automation is to make it consistent and repeatable. Using implicit configurations like :analysis :all can sometimes make repeatability harder.

The clj-kondo version would probably still provide a stable basis, but if someone ever wants to do analysis of clojure over time using dewey data, then it's much easier to look at all of the analyses based on an explicit analysis config rather than looking at the clj-kondo version and reverse engineering what analysis is actually included.

I would much rather have a way to query clj-kondo for what types analysis are available so that it makes it easier to update the config dewey uses with all the available analyses.