This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (5)
- # announcements (4)
- # babashka (2)
- # beginners (52)
- # calva (13)
- # cider (60)
- # clj-kondo (101)
- # cljsrn (6)
- # clojure (93)
- # clojure-brasil (2)
- # clojure-dev (37)
- # clojure-europe (5)
- # clojure-italy (7)
- # clojure-nl (8)
- # clojure-norway (1)
- # clojure-sg (1)
- # clojure-spec (115)
- # clojure-uk (31)
- # clojurescript (32)
- # cursive (35)
- # data-science (4)
- # datascript (3)
- # datomic (29)
- # emacs (8)
- # events (1)
- # figwheel (1)
- # funcool (2)
- # graalvm (2)
- # joker (12)
- # kaocha (4)
- # lein-figwheel (1)
- # leiningen (34)
- # malli (7)
- # off-topic (4)
- # overtone (1)
- # parinfer (2)
- # pathom (5)
- # quil (1)
- # re-frame (12)
- # reagent (2)
- # shadow-cljs (7)
- # spacemacs (6)
- # sql (17)
- # tools-deps (63)
- # vim (24)
I've merged the final thing I wanted to get in for the next release. If you can give it one more try later today, then I'll make a release if there are no other problems. @mynomoto: Linux: https://6280-176829714-gh.circle-artifacts.com/0/release/clj-kondo-2019.09.23-alpha-SNAPSHOT-linux-amd64.zip
https://github.com/borkdude/clj-kondo/issues/496 <- this may be very tricky because core.match looks like a quite complicated macro
well maybe a 1st approximation would be to just consider all non-quoted symbols in the pattern part to be available in the consequent part
Right. It is possible to implement, no doubt, but just pointing at a workaround for now.
ok, maybe… I’ve been thinking about trying my hand at implementing something to clj-kondo
what aliases should I use with cider-jack-in, having trouble running
clj-kondo.main-test from cider
@tatut I start it like
clj -A:test:cider-nrepl from the command line. I never use cider-jack-in because I'm old fashioned. I connect with cider-connect.
I got it running and made a new corpus/core_match/match.clj with the failing case and added a test to main_test.clj which now fails
If I understand this correctly, I would add to the
(case [resolved-as-namespace resolved-as-name] case in analyzer.clj
as I've already mentioned, the let linting is probably similar. maybe also the core.async alt macro
(I can never remember if that should be plural and with or without exclamation marks and how many)
I’m unclear what I should return, but I’ll fire up the cider debugger and inspect things
what you should do to prevent false positives: extract the bindings from the form that introduces them, add them to the ctx under :bindings and then lint the children nodes using that ctx
just eval some existing linter impl in debug mode, run the test and see the values flowing
great. if you're implementing this like the other macros, then you should also get "unused bindings" in your match macro
oh yes, so if you introduce a binding in pattern but don’t use it… I’ll make a test case for that as well
symbol to map with row and col. this is typically produced by the function extract-bindings
hi.. i'm trying to get clj-kondo working on Windows.. found this https://github.com/borkdude/clj-kondo/issues/276 .. is there anything to do to help with this or is it basically that GraalVM folks need to sort something out?
@sammikko The issue is like this. You need to install a C++ redistributable on the system where the binary is compiled. Also you need to install from the command prompt that comes with this, so certain dlls are in scope (if I understand correctly). But these dlls are not statically linked (afaik that's not possible yet with GraalVM on Windows). So when you copy the resulting binary to a different system, then it will crash because of a missing dll.
@sammikko There is some documentation here for building on Windows: https://github.com/borkdude/clj-kondo/blob/master/doc/build.md#windows
If you can find out a solution for Windows users, this is welcome. You might also be able to find out of you can just run the linux binary with WSL2.
There is an issue on Graal for the dll stuff, but there hasn't been any news there for a while.
right ok.. I managed to build the exe using the instructions.. but there is no output.. also tried to copy msvcr100.dll in the same dir as exe, but no luck.. it starts but there is no output.. without --lint it does display the usage instructions tho
FWIW you can always run clj-kondo on the JVM as a lib or uberjar, but that won't be pleasant in an editor.
Might also be worth looking into GraalVM documentation around Windows. Maybe things have changed meanwhile.
Not sure about this. I'm not using Windows frequently and don't know a lot about the OS internals.
What could also work is writing an nREPL integration for clj-kondo, so you run it as a lib inside your editor REPL.
right.. do you mean like starting up the clj-kondo on JVM but keeping the process alive and feeding it the "files" with some protocol ?
like cider-nrepl which is also a development-time library which lives in your REPL process
well its good to have options 🙂 ill need to do some reading on GraalVM etc.. thanks for the help!
I started doing clj-kondo because I wanted additional linters to joker. But in time I think it caught up with joker pretty well.
I was using joker for a while with flycheck in emacs and got pretty annoyed with false positives
a bunch of stuff here https://github.com/candid82/joker#reducing-false-positives
clj-kondo has a slightly different take on macros: you can teach it to lint custom macros as clojure.core macros. for example: lint manifold.deferred/let-flow as clojure.core/let
I would say: spend 20 minutes watching my talk at ClojuTRE to learn what it can do and then decide if you want to install it.
oh I have it installed right now and it seems fine, I was just wondering if there were major differences in use or issues or philosophy that I'm not seeing
I'm seeing a false positive being caused by
clj-kondo not ignoring a
defn that I have tucked away in a
(comment) block. I took a look through the issues on github but didn't spot anything similar, is this a known issue? Would you like me to create an issue?
it's a design choice: comments often contain example code that I still want to have linted
if you want to ignore comments there's an option for that. but you can also choose to use uneval to comment out the defn.
That makes sense, though in this specific case of
defning a function, it seems like the linter picking up the commented out function signature could cause other false positives in non-commented code
true. personally I don't put defns in comments though, just calls (like a REPL session that could become a unit test)
yeah, my next comment would be that I probably should be leaving this in here like this. It's an unfinished bit of code that I want to record but come back to later