This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-19
Channels
- # announcements (3)
- # asami (3)
- # babashka (39)
- # beginners (65)
- # calva (13)
- # cider (4)
- # clj-kondo (69)
- # cljdoc (19)
- # cljs-dev (2)
- # clojure (90)
- # clojure-dev (10)
- # clojure-europe (61)
- # clojure-france (15)
- # clojure-nl (8)
- # clojure-uk (2)
- # clojurescript (28)
- # conjure (2)
- # core-logic (4)
- # cursive (8)
- # datalevin (5)
- # datascript (7)
- # datomic (14)
- # depstar (4)
- # events (1)
- # graphql (7)
- # holy-lambda (5)
- # jobs (5)
- # kaocha (1)
- # malli (14)
- # membrane-term (13)
- # missionary (13)
- # nextjournal (6)
- # off-topic (1)
- # polylith (15)
- # portal (10)
- # re-frame (35)
- # reitit (1)
- # remote-jobs (3)
- # schema (3)
- # sci (121)
- # spacemacs (6)
- # tools-build (8)
- # tools-deps (74)
- # xtdb (7)
I'm considering to automatically opt in to configs that are found in:
.clj-kondo/<org>/</lib>/config.edn
From a usability standpoint this would be much better.
But there might be some dangers to this. E.g. a library could accidentally export a config which will make clj-kondo crash or get stuck in a loop while expanding a macro or so. Any thoughts?@U09LZR36F I don't think there is one yet. I'll create one now.
Fwiw, my opinion on the security of this is that you're already loading my code I can be as malicious as I want 🙂
Perhaps this should be an option: :auto-include-configs true
which can be set to false in case of difficulties?
Yeah, that seems good to me. So the only way exports get imported is if --copy-configs
and --dependencies
option are specified. So it seems like a deliberate action in itself.
Then again, I think clojure-lsp calls with these options so maybe not so obvious in this case.
Since lsp already does this all the time, there are lots of users that have already opted in without knowing
Just wrote a (clj-kondo) macro for my (clojure) macro: https://github.com/babashka/sci/blob/master/resources/clj-kondo.exports/babashka/sci/sci/core.clj#L3
-ish yeah, you write (sci/copy-ns <ns-sym> <sci-object> <opts>)
but since it's a macro you don't quote <ns-sym>
and <opts>
I suppose with auto-opt-in for imported configs… the only risk of a support headache would be an errant hook. But I suppose you could blacklist a bad hook if it comes to that. Which it probably won’t.
Another option would be to emit clj-kondo warnings for hooks that are present but not activated.
I'm thinking about the LSP use case. Do users see those warnings? I usually don't in emacs, unless I go look into some dark corner of some logs
Ah, as opposed to squigglies in place? I often show flycheck error list. But there’s a chance I might be odd.
clj-kondo could make info warnings on the first line or so: you have this or that config not activated
Perhaps @UKFSJSM38 could enlighten us.
there is a custom code on lsp-mode that register a lsp-flycheck, all LSP diagnostics use that: ref: https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-diagnostics.el#L36
yeah, we only show on log indeed, not sure it makes sense to use diagnostics feature for NPE that could happen anywhere on the code
Usually, LSP diagnostics are related to user's code, a NPE means a clojure-lsp or third error, user don't care about that, but if something stops working and he wants to understand he should seek the logs I think
or at least we catch the excpetion, log and show a pretty message like "Some error ocurred"
like user tries to rename something, and we can't for some reason, we return that message explanining why we couldn't rename
I got your point, I just think LSP showMessage would be something that should fit better
https://microsoft.github.io/language-server-protocol/specification#window_showMessage
sorry for the delay: > Since lsp already does this all the time, there are lots of users that have already opted in without knowing Yes, having that enabled by default would be really good for users IMO, the corner case probably could be solved with a option to disable a hook or something like you mentioned > I'm thinking about the LSP use case. Do users see those warnings? I usually don't in emacs, unless I go look into some dark corner of some logs Yeah, they will only see the warnings if they search on the logs, is not something we show activelly for the users.