Hi there. A quick suitability check, if you don't mind. The third argument to function foo in our codebase is either a string literal, or a variable which is a string literal, or a value out of a map literal. In other words, if you're reading the source, you can figure out the whole universe of strings passed for this argument; nothing is determined at runtime.
Can clj-kondo be used to enumerate the set of strings passed to foo? At first glance, I see some information about arguments is available, but it doesn't seem like something of this sort would be.
Hi @nick383! Do you mean, implement a custom linter, or just have clj-kondo spit out some information separately from using it as a linter?
The latter - the information is valuable for a purpose different than linting.
I started out looking into tools.analyzer, but wondered if that might be overkill
Can you give an example of a string coming from a variable or map?
Based on that I might have different options for you
(def bar "bar")
(foo arg1 arg2 bar)
(def foos {:baz "baz"})
(foo arg1 arg2 (:baz foos))I'm afraid I must now turn in for the night - currently I'm in South Korea. I'll be back online tomorrow. Thanks so much for your quick response here, and for your help!
OK, come back tomorrow and then we'll talk more
Just ping me here
Currently clj-kondo doesn't emit any literal values used as arguments, but I was thinking that grasp may help here: https://github.com/borkdude/grasp