This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-11
Channels
- # ai (1)
- # announcements (59)
- # aws (3)
- # babashka (16)
- # beginners (36)
- # calva (29)
- # cider (7)
- # clj-kondo (33)
- # clojure (77)
- # clojure-austin (1)
- # clojure-australia (4)
- # clojure-europe (16)
- # clojure-france (7)
- # clojure-nl (2)
- # clojure-spec (1)
- # clojure-sweden (8)
- # clojure-uk (4)
- # clojurescript (17)
- # cloverage (4)
- # conjure (2)
- # cursive (3)
- # datomic (22)
- # emacs (16)
- # fulcro (10)
- # graphql (3)
- # helix (13)
- # jobs (1)
- # kaocha (1)
- # lsp (7)
- # malli (1)
- # nextjournal (1)
- # off-topic (32)
- # pedestal (8)
- # polylith (5)
- # reitit (4)
- # reveal (1)
- # shadow-cljs (67)
- # spacemacs (7)
- # tools-deps (6)
- # xtdb (4)
[RESOLVED] Hi \o I'm trying to update my clj-kondo
from the CLI and I'm having (it appears to be an GH issue, but letting here just FYI). But I'm able to download the zip from the releases page o/
$ ./install-clj-kondo
Downloading
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"">
<html>
<head>
<title>503 Backend.max_conn reached</title>
</head>
<body>
<h1>Error 503 Backend.max_conn reached</h1>
<p>Backend.max_conn reached</p>
<h3>Guru Mediation:</h3>
<p>Details: cache-for8427-FOR 1641867116 4140388333</p>
<hr>
<p>Varnish cache server</p>
</body>
</html>/clj-kondo-
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"">
<html>
<head>
<title>503 Backend.max_conn reached</title>
</head>
<body>
<h1>Error 503 Backend.max_conn reached</h1>
<p>Backend.max_conn reached</p>
<h3>Guru Mediation:</h3>
<p>Details: cache-for8427-FOR 1641867116 4140388333</p>
<hr>
<p>Varnish cache server</p>
</body>
</html>-macos-amd64.zip to /tmp
Can't reproduce:
$ mkdir k
$ ./install-clj-kondo --dir k
Downloading to /tmp
Successfully installed clj-kondo in k
Must be a Github hiccupYes, thanks, I guess it was it, want me to delete the message?
Does clj-kondo
have a way to say that a :type-mismatch
function type is closed?
For example, instead of
{:arities {1 {:args [{:op :keys,
:req {:person-external-id :string}}],
:ret {:op :keys,
:req {:name :string}}}}}
we would have something like
{:arities {1 {:args [{:op :keys,
:req {:person-external-id :string}}],
:ret {:op :keys,
:closed true ;; <<--------------
:req {:name :string}}}}}
and the return could be used for stronger type inference.
I have seen that there is https://github.com/clj-kondo/clj-kondo/issues/783, but it's just weakly related from where I see.I could help on it if needed o/ Just don't know where to start
It hasn't got this. I think we should first discuss if we want this before starting on an implementation. See https://github.com/clj-kondo/clj-kondo/blob/master/doc/dev.md#workflow
I think the related issue should be solved first before you would even benefit from this probably, but that you could explain in a Github Discussion or issue
Yes, sure, I wouldn't start a PR without an issue o/ Thanks, so I will wait for the related issue to be resolved and I see what's needed from there (also it will give me more time to understand more of the clj-kondo codebase)
Thanks o/
You could perhaps look into solutions(s) for the open issue. I haven't really investigated this myself yet
Ok, nice, I will try to check it after this weekend (vacation). Is https://github.com/clj-kondo/clj-kondo/blob/d9fca2705863e3e604e004ccb942e0b3d2e268ec/src/clj_kondo/impl/types.clj#L318 a good place to start to look into this issue?
Thanks o/
Clj-kondo marks
(keep #(if (odd? %) %) (range 10))
as missing else branch, where it is okay to do it like this
https://clojuredocs.org/clojure.core/keep#example-542692cfc026201cdc326e82
Also the problem I have with it is that the whole editor goes yellow. (screen below)@mateusz.mazurczak.dev It is ok, but the style clj-kondo encourages is to use when
if you don't have an else branch.
The yellow thing is something in the plugin, not something clj-kondo can fix. /cc @brcosta
You can post an issue here about the yellow stuff: https://github.com/brcosta/clj-stuff-plugin
Thanks for the response. I will report that. Also the errors stay the same for a long time unless I go and edit it more. So for example as you mentioned I changed if -> when. But the clj kondo still marks it as the previous error missing else branch. This happens often and is really annoying. Here is a recording of the issue: https://watch.screencastify.com/v/d65Ebva8KvLDIdUTJofr
Hi, thanks for reporting! I’m aware of the issues, just need some more time to fix them! Already have a proof of concept for the lag thing. About the missing branch going all yellow it’s the way Intellij highlights warnings, maybe I need to use another type of annotator for these cases, I’ll see. Again, thanks for reporting! 🙂
I just uploaded a fix for the performance issue, we need to wait for Jetbrains to approve it. If you want to test it sooner just DM me and I can send a prebuilt install package. About the yellow highlight I guess the easiest fix is to edit the default color scheme. If I have any other idea I let you know 😉
It's helpful that you have the screencast though, for the plugin author to see what's going on.
Yeah, spending minute on the error because you have whole screen yellow is pretty annoying
Especially if some warning shows while writing code and stays after you finish
Sorry, just ranting 😄
I recently switched to intelllj from emacs, maybe I will go back 😉