This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-19
Channels
- # announcements (41)
- # babashka (25)
- # beginners (11)
- # calva (15)
- # clj-kondo (34)
- # clojure (25)
- # clojure-france (2)
- # clojurescript (69)
- # conjure (1)
- # cursive (23)
- # datalog (3)
- # datomic (4)
- # deps-new (2)
- # emacs (31)
- # helix (1)
- # hoplon (1)
- # lsp (8)
- # luminus (17)
- # malli (5)
- # meander (1)
- # nrepl (7)
- # off-topic (1)
- # polylith (6)
- # portal (3)
- # reitit (15)
- # shadow-cljs (1)
- # xtdb (16)
I think I found one more potemkin corner case that I think we should consider on fixing it on clj-kondo 馃У
not sure though how to get the namespaces from the alias on clj-kondo code at that time
Also, it's possible to pass multiple vectors, but I think kondo is handling those already
@UKFSJSM38 should be fixed on master
it worked! thank you!
FYI @U11BV7MTK this should help with a lot of false positives on metabase
, probably the rest is just macros that should be configured on clj-kondo side with lint-as and custom hooks :)
I'll include this clj-kondo bump on the next clojure-lsp release, thanks for the help @U04V15CAJ
using the metabase as example again, I found a issue related to custom configuration like :lint-as
for macros that are being used by potemkin
For example: metabase has https://github.com/metabase/metabase/blob/master/test/metabase/test/data.clj#L204 dataset
macro that I want to lint-as def
.
I added this to the .clj-kondo/config.edn
:
{:lint-as {metabase.test.data/dataset clojure.core/def}}
but that doesn't seems to work for the usages that use potemkin under the hood, for example https://github.com/metabase/metabase/blob/master/test/metabase/query_processor/pivot_test.clj#L86.
This only works if I change the lint-as to the namespace that import the vars with potemkin like:
{:lint-as {metabase.test/dataset clojure.core/def}}
The user could add both namespaces to the lint-as is just that seems something clj-kondo could be smart and already check for the config for that imported potemkin var, right? Also, the same happens for hooks configuration
Sorry for bringing a lot of bugs, is just that I found metabase
a good project to find/test LSP and see what doesn't work/could be improved :)
we need to read the cache in an earlier phase to support this so it's not a trivial change
I added a TODO test: 0ae0e51158570d3c94be7c0c7b16c0c8cc593ecb You're welcome to make an issue about this but I don't consider this high priority for now (weighing the complexity vs how much effort it is to configure this)
Sure, that's fair, I only found 3 macros until now in the metabase that fall into this issue, but I agree this is no high priority
FWIW, I wrap a lot of library macros and functions this way (the indirection is useful if you want to augment or modify the original behavior systematically throughout your application) and sometimes end up adding both the wrapper and the original macro to clj-kondo. It's not pretty, but it has not been a deal-breaker so far.
^ I don't think this is inherently related to potemkin; but I may be wrong and some of my config linters are no longer necessary.
I'm not sure what you meant by the last sentence: you no longer need config which you needed before?
{:lint-as
{metabase.test.data/dataset clojure.core/def
metabase.test/dataset clojure.core/def}}
^ I was thinking that ideally one of these would be enough, and the other could be inferred.Yep, I wanted to just add a datapoint that I come across this problem in my own projects, it'd be nice if it were fixed, but it's not something I consider a very thorny issue that is a pain to deal with it. If that was not obvious, sorry for adding to the noise. :)