Fork me on GitHub
#clj-kondo
<
2020-04-22
>
martinklepsch08:04:31

Does anyone know if there’s a way to make warnings non-fatal in the DeLaGuardo/clojure-lint-action@v1 GH action?

delaguardo08:04:22

can you share your action output? currently action should exit with 0 exit code in case “warnings only | no errors”

martinklepsch08:04:17

Yes, it’s doing that. The task itself exists with 0 (i.e. passes) but the “clj-kondo check” has warnings and is marked as failing:

delaguardo08:04:19

ok, got it. I will check github’s api

delaguardo11:04:55

I used “neutral” check status to indicate that there are some warning. What do you think?

delaguardo11:04:29

you can test it from the branch DeLaGuardo/clojure-lint-action@status-check

martinklepsch11:04:40

Yes, I think that would make sense to me, perhaps it could also be configurable?

martinklepsch11:04:02

I guess it would be nice to be able to see when you previously had no warnings but a given change introduces some

martinklepsch11:04:10

but I guess then it would go from green to gray

martinklepsch11:04:19

So maybe config isn’t actually required

delaguardo11:04:19

GH check-run status is a bit restrictive

martinklepsch11:04:38

Cool makes sense. I guess once we’ve fixed all warnings we might want the status to be “Failed” when new warnings are introduced. But “Neutral” is also ok for now.

delaguardo11:04:21

I would like to keep the config as small as possible. don’t think the option like what to do in case of neutral status make a lot of sense.

delaguardo11:04:40

also it is not possible in general to get status of previous check-run because GH can mark it as stale

martinklepsch11:04:45

Yeah I mean more like being able to tell the action to use “Failed” or “Neutral” state when there are warnings

martinklepsch11:04:27

Have you considered filtering warnings so that they are only added to changed lines?

delaguardo11:04:19

yes, and this is possible, already checked that out

delaguardo11:04:55

just need more time to finish

borkdude11:04:49

@U050TNB9F What if you change the arity of a function and don't change callsites accordingly? Then you won't be warned about that?

martinklepsch11:04:54

@U04V15CAJ good point! but I guess that would be an error and errors should always be shown

borkdude11:04:29

@U050TNB9F Some people use ReviewDog to accomplish only being warned about new warnings and errors

delaguardo08:04:41

I’m working on it right now)

mauricio.szabo15:04:22

Hi, I was looking if there's any way to make kondo ignore a specific namespace "required but never used". Also, I think I found a bug - clj-kondo warns that this required is never used, but down below the code it is being used: https://github.com/mauricioszabo/atom-chlorine/blob/master/src/chlorine/repl.cljs#L8

borkdude15:04:50

@mauricio.szabo I think this is caused by:

[chlorine.ui.atom :as atom]
[repl-tooling.editor-integration.evaluation :as e-eval]
["atom" :refer [CompositeDisposable]]
so now atom becomes ambiguous

mauricio.szabo15:04:20

Because of "atom" require, or because atom (the alias) becomes ambiguous with the function?

borkdude15:04:30

the alias is ambigious because there is a namespace called atom but also a namespace alias atom

mauricio.szabo17:04:15

I don't understand, to be honest. The namespace, you mean, is the "atom", as string? Because that's a javascript require...

borkdude17:04:49

@mauricio.szabo I think we can reproduce the bug simply in terms of normal Clojure:

(ns a) (def x :a)
(ns b) (def x :b)
(ns c (:require [a :as b] b))
b/x
This says that namespace a is unused, while in reality, it's b that's unused. So aliases have preference over full namespace names

borkdude17:04:05

I'll make an issue

borkdude17:04:15

renaming your alias to something else will fix this for now

mauricio.szabo18:04:05

Wow, already? Thanks a lot 👍