Fork me on GitHub
#clj-kondo
<
2019-10-04
>
pez04:10:34

I hope to find some time to see if I can write an nrepl middleware that can start clj-kondo in-process. FWIW

borkdude07:10:05

@pez nice! I enjoyed the interview with you on the ClojureScript podcast btw. good work!

borkdude07:10:58

One alternative for Windows users could also be to use the Docker build. But I wonder if WSL/WSL2 isn't a better fit if you go that way maybe.

pez07:10:50

Thanks! It was recorded in May or something, so a lot has happened since. 😃 But still this linter feature that I'd really like to make it easier to use, while also letting Clojure Lint handle the actual integration of the linter and VS Code.

pez07:10:57

Yes, I think WSL works. But I want it to work without all that. 😃 I want it to be a no-install when using Calva. So Calva would bundle Clojure Lint, and linting would just be there, is where I want things to be. Not sure I'll be able to get there, but I'll give it a try before I stop dreaming about it.

pez07:10:34

I think that it might be a usable general pattern to have nrepl start Clojure tools that the editor integrations need.

dharrigan11:10:17

Arch updated too

❤️ 8
😎 4
Heikki Hämäläinen12:10:30

I have a next core.match code which triggers an error in clj-kondo: (match [(-> description :status keyword)] [:SUCCEEDED] {:status :SUCCEEDED :customer_id (parse-customer-id description)} [:RUNNING] {:status :RUNNING} [(:or :FAILED :TIMED_OUT :ABORTED)] {:type :internal-server-error :message (:aws-step-function/failed error/keywords)}) The problem is (:or :FAILED :TIMED_OUT :ABORTED) which causes “error: keyword :or is called with 3 args but expects 1 or 2”. That part is core match spesific syntax. Is there way to suppress error in this case?

tatut12:10:05

btw, I’m working on a PR to support core.match

tatut12:10:22

you could comment on that issue

tatut12:10:34

I can add that as a unit test for core.match support

Heikki Hämäläinen12:10:05

Great, i am putting this as a comment in the PR also for a reminder.

juhoteperi13:10:49

Is there an option to disable if Missing else branch. warning?

dharrigan13:10:52

Could you use when instead?

juhoteperi13:10:21

Nope, existing codebase has 600 of these warnings and I don't agree that when should be used if there is only then branch and if when there are both then and else. (I think when is useful for side-effects)

borkdude13:10:48

@juhoteperi yes: {:linters {:if {:level :off}}}

juhoteperi13:10:47

Ah thanks. Is there list of linter keys somewhere? This option isn't listed in the docs, but I guess not all linter need to be listed, if they only have level option.

juhoteperi13:10:27

... yes, config doc mentions all the keys are listed in default config 🙂

borkdude13:10:05

yeah, it's in clj-kondo.impl.config.clj... could do better there, but I guess you can find it 🙂

juhoteperi13:10:59

Btw, I've been collecting ideas for linters while reviewing code recently: https://gist.github.com/Deraen/85ab85a626844a4142cc5754484adae4 maybe some of these make sense?

borkdude14:10:04

@juhoteperi I've just read them. Although I think they're interesting, probably not everyone will agree with these linters, which is OK, but like you are now experiencing with if, people will have to turn off the linter in existing code, etc. What you can also do is create issues for these linters and over time these could collect feedback and if there is a clear desire from the community to have specific ones, we can choose to implement them.

borkdude14:10:14

Btw, you can also choose to set :if to level :info, this way you will still get feedback (at least in Emacs). Nothing is wrong with free info maybe?