This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-03
Channels
- # aleph (5)
- # announcements (4)
- # babashka (2)
- # beginners (52)
- # calva (13)
- # cider (60)
- # clj-kondo (91)
- # 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 (8)
- # 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
For Mac users: https://6281-176829714-gh.circle-artifacts.com/0/release/clj-kondo-2019.09.23-alpha-SNAPSHOT-macos-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.
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.
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 defn
ing 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
@sammikko fwiw, my last understanding of the situation was that one significant issue was this: https://github.com/oracle/graal/issues/1469. i'm not as confident as others regarding whether there isn't something one can do about the dll as i got some private assembly clj-kondo working to deal with the dll part. also, i think there's a chance at an ugly work-around: > using an additional program that can handle stdin / stdout communications properly to have it act as an intermediary / wrapper around Windows native-image programs generated from Clojure source. (see https://github.com/borkdude/clj-kondo/issues/276#issuecomment-517900704) the additional program would write what it receives from the invoker to disk and clj-kondo would read from disk -- after processing, clj-kondo would write the results to disk and the additional program would read them back and send them back to the invoker appropriately. the additional program could be written in rust, go, nim, etc. i got wiped out working on this before and have not seen any activity on oracle's side. i also think it would all-around be better to not be using dlls when you don't have to (see: https://github.com/oracle/graal/issues/1407#issuecomment-508688008 for details)
good work digging into this.. I tried your patch where in was changed to System/in and out to System/out... It seems to work different if I have .clj-kondo directory in effect with config.edn... even with the patched version, it crashes if I lint my project directory having .clj-kondo. If I try the same dir without .clj-kondo, it works and outputs the same warnings as in OSX..
I'm trying to "debug" it using Sysinternals Process Monitor tool.. it seems that it processes all the files, but then in the end it tries to call QueryAllInformationFile for .clj-kondo\.cache\2019.09.23-alpha-SNAPSHOT\lock resulting in BUFFER OVERFLOW
I didn't find any difference with msvcr100.dll, tried putting in same dir as .exe (dir is in PATH), current directory etc..
Hmm.. its probably not a real buffer overflow: https://blogs.technet.microsoft.com/markrussinovich/2005/05/17/buffer-overflows/
it may take me a bit to recreate the context due to various factors including an aging brain 🙂 if you didn't see it already, here's a repository documenting what i think is a native-image issue: https://github.com/sogaiu/constdin -- it should have instructions on ending up with a stacktrace. for the dll side of things, i don't have anything written up, but i can dig up the sxs private assembly stuff that seemed to work if you think that might help. let's see if i can attach it here -- the version of clj-kondo is from a bit back, but iirc, the important bits are the specific manifest files along with things being consistent with what's described within them.
if you do build your own clj-kondo.exe on windows successfully, you may find that it works better when launched from within the special console "Windows SDK 7.1 Command Prompt" setup provided by windows 7 sdk. i think we found that the built executable tended to work better on the machine / environment where it was built. i got hard-to-explain varying behavior depending on which shell the executable was launched from. the 4 shells i tested among are mentioned at the constdin repository linked above. regarding the build process, i had a lot of difficulty getting the build environment set up appropriately -- a straight-forward install of the windows 7.1 sdk just would not work. fwiw, here are my notes: https://gist.github.com/sogaiu/e079cd770051685c46ab24b6658effcf -- but may be you have this all working already 🙂