This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-06
Channels
- # aleph (70)
- # announcements (9)
- # babashka (43)
- # babashka-sci-dev (6)
- # beginners (97)
- # cider (2)
- # clj-commons (3)
- # clj-kondo (41)
- # clojure (88)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-spec (22)
- # clojurescript (65)
- # community-development (6)
- # conjure (10)
- # cursive (6)
- # datahike (13)
- # datomic (4)
- # eastwood (11)
- # events (1)
- # fulcro (45)
- # graalvm (1)
- # graphql (3)
- # hyperfiddle (3)
- # integrant (7)
- # jobs (1)
- # lambdaisland (1)
- # lsp (58)
- # nbb (4)
- # nrepl (3)
- # pathom (15)
- # shadow-cljs (27)
- # tools-deps (1)
please may we also have the clj-kondo bb pod updated to 2022.10.05
? 馃槍
amazing thank you!
fyi, we now bump both the jvm and bb pod at the same time, so there's a +1 to 'number of people needing coordinated releases' for your usage data 馃檪
that's be lovely, yes please 馃槃
馃憢 is it possible to add #p
as an discouraged var.. or rather reader macro?
currently not, but there is a :config-in-tag
option which configures linting behavior in tags. Not sure if this will help in this case, probably not
loving #p a ton, but occasionally it slips into commits thanks for a prompt reply
I know. My secret is that I never add it to the checked-in deps.edn, just keep it in my user-level one so in theory it should fail compilation
How does :redundant-fn-wrapper
work? It seems like it only recognizes a predefined set of functions?
noah@cb-dell ~/work
$ echo "(let [as-uuid parse-uuid uuids (map str (range 10))] (map #(as-uuid %) uuids))" | clj-kondo --lint - --config "{:linters {:redundant-fn-wrapper {:level :error}}}" --cache false
linting took 5ms, errors: 0, warnings: 0
$ echo "(let [uuids [{:a 1}]] (map #(:a %) uuids))" | clj-kondo --lint - --config "{:linters {:redundant-fn-wrapper {:level :error}}}" --cache false
linting took 8ms, errors: 0, warnings: 0
also with keywords for some reasonI also found that in some cases redundant-fn wrappers are still desirable, e.g. for hot reloading
Thanks for the PR. I'm going to check if I can see some interesting new discoveries when I'm running the lint diff
Sometimes you can discover cases that aren't working properly, so that would be good before merge
no rush! just something I noticed after cleaning up the existing lint warnings in our production codebase
< clojure/inspector.clj:120:17: warning: Redundant fn wrapper
3125d3123
< sci/impl/utils.cljc:204:38: warning: Redundant fn wrapper
3367c3365
I have a fix for :include-macros
bug from github earlier today, but I see that we could be more strict about it than just passing over it. Clojurescript's https://github.com/clojure/clojurescript/blob/a4673b880756531ac5690f7b4721ad76c0810327/src/main/cljs/cljs/core/specs/alpha.cljc#L130 says it only accepts true
. Should I convert this fix (that merely discards the form) to a new linter that checks to make sure the option is the literal true
?
Right, I'll include that
Is that something you want to warn about or just skip if in clojure?
looks like we're not doing such checks for other :require options
Perhaps in a .cljc
situation it's convenient to leave it in, if it also works for clojure
I mean that :refer-macros
is allowed in clojure, but we could lint it:
$ clj
Clojure 1.11.1
user=> (require '[clojure.string :refer-macros [join]])
nil
user=> (join " " (range 10))
Syntax error compiling at (REPL:1:1).
Unable to resolve symbol: join in this context
yeah, clojure doesn't care
This works but doesn't feel ideal so let me know how you want to go with it
To me this feels way too much for simple syntax check, I wouldn't even introduce a new linter for this. Just a warning with type :syntax
Oh yeah, I completely forgot about that one. Thanks, I鈥檒l clean it up
Updated, much simpler now. I included a change to make :unknown-require-option
default to :off
, which should help everyone out in general