-
-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide all metadata from vars analysis #1280
Comments
@latacora-gabriel Interesting. An alternative approach could be to just iterate over all vars using |
Unfortunately that won't work b/c I'm looking to do this analysis with bb and most of the namespaces I want to analyze aren't bb compatible |
One of the problems here is that not all metadata on vars is valid EDN since you can put arbitrary objects on there. Perhaps we can make a configurable filter of a list of keys that people can provide:
? |
That would be great :)
…On Fri, May 14, 2021 at 4:23 AM Michiel Borkent ***@***.***> wrote:
One of the problems here is that not all metadata on vars is valid EDN
since you can put arbitrary objects on there. Perhaps we can make a
configurable filter of a list of keys that people can provide:
{:config {:output {:analysis {:meta {:select-keys [:repl]}}}}}
?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1280 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT3CAATMQLRYHKITK533KE3TNTMXHANCNFSM44W6AUQA>
.
|
As discussed with @IGJoshua: Add option We need one extra clj-kondo/src/clj_kondo/impl/analysis.clj Line 38 in 21de6f4
We could also implement |
OK, I thought more about it. I think we should let the user do the selection and validation they want in a function and support:
So you can just select the extra metadata you want and the burden of validation is on the consumer. We can support this option on the command line too by evaluation the function in SCI. Passing a boolean The selected metadata will end up in |
/cc @lread |
This looks good to me. Would this also grab metadata from ns defs? |
Yes, |
Sorry, a horrible choice of wording on my part! I mean metadata on namespaces like so: (ns ^:no-doc my-ns.here) |
Going that direction sounds great, but I think unless I missed something is beyond what I know of how clj-kondo works, so it might be best (especially with my time constraints recently) if someone else were to take over making a PR for this. |
@IGJoshua That is fine, thank you for your work so far! |
@lread We can support a similar |
@borkdude and I decided to do a Clojure core team style spreadsheet to go over options, we think it went pretty well. |
…th analysis data for vars and nses (#1418)
Co-authored-by: Lee Read <[email protected]>
@latacora-gabriel This should now be available on master. See https://github.com/clj-kondo/clj-kondo/blob/master/analysis/README.md#extra-analysis Please test it out if you have time. Should be available as pod after next clj-kondo release. |
@latacora-gabriel OK, released and pod was also updated. Let me know how it goes. |
@borkdude I've been away for awhile. Confirmed this works great with cldwalker/bb-clis@3ad1b4a. Thanks! Example use on the babashka repo:
|
Hi @borkdude. Once again thanks for your awesome tool!
Is your feature request related to a problem? Please describe.
I'd like to be able to mark vars with metadata and the filter vars with that metadata using analysis'
:var-definitions
in a bb script. With this feature, I could write bb scripts that generate configuration for tools that have var configuration. For example, I could generate a carve ignore list by marking fns with^:repl
Describe the solution you'd like
It'd be helpful for a var in
:var-definitions
to include all the metadata it contains. This metadata could be at the top level or under a:meta
key if that seems cleaner. It seems analysis obtains a var's metadata and then only provides some of that metadata as analysis data.Describe alternatives you've considered
I think
:var-definitions
is the most appropriate place to contains this analysis data. I don't know of other tools that could provide this data as effectively in a bb scriptThe text was updated successfully, but these errors were encountered: