This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-19
Channels
- # announcements (1)
- # asami (75)
- # beginners (16)
- # calva (14)
- # cider (4)
- # clj-kondo (11)
- # cljs-dev (3)
- # clojure (110)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (38)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-sg (1)
- # clojure-spec (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # clojurescript (34)
- # conjure (1)
- # data-science (9)
- # datahike (7)
- # datalevin (1)
- # datascript (1)
- # datomic (5)
- # etaoin (1)
- # fulcro (23)
- # graalvm (50)
- # helix (4)
- # hyperfiddle (8)
- # introduce-yourself (1)
- # jobs (3)
- # kaocha (10)
- # malli (8)
- # mid-cities-meetup (1)
- # minecraft (1)
- # off-topic (13)
- # pathom (14)
- # polylith (38)
- # reitit (1)
- # releases (1)
- # sci (65)
- # shadow-cljs (28)
- # specter (12)
- # tools-deps (8)
- # vim (1)
- # vscode (11)
- # xtdb (31)
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 @U01BA210C7K! 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
(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!
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