Fork me on GitHub
#clj-kondo
<
2019-10-24
>
borkdude06:10:53

Do you also get it when running clj-kondo from the command line?

borkdude07:10:38

I bet you're in a .cljc file?

sogaiu07:10:15

yes, that's right

borkdude07:10:29

you're getting that error because alias is not valid in CLJS (or at least clj-kondo thinks so). so when you wrap it in a conditional #?(:clj ...) the warning goes away

sogaiu07:10:53

ah, ok, thanks. makes perfect sense.

sogaiu07:10:21

i wonder why i'm not seeing the same thing via flycheck in emacs

borkdude07:10:25

I see the same behavior in flycheck+emacs, so it's probably an installation thing

sogaiu07:10:15

ah, will investigate

sogaiu07:10:55

yes, it was a local thing. sorry for the noise. i'm not using the vanilla clojure-mode so i should have known 🙂

sogaiu10:10:12

it turned out there was one more twist -- depending on whether i launched emacs from a terminal or not, exec-path was different. that was also an "installation thing", but at a lower level. til -- flycheck automatically disables checkers for various reasons -- M-x flycheck-verify-setup can be of some help, but it seemed convoluted to have to use C-u M-x flycheck-disable-checker to re-enable...

borkdude10:10:45

yeah. what I also find useful is running flycheck-compile

sogaiu10:10:15

ah, that gives more detailed output i guess. nice. thanks for the tip!

sogaiu10:10:46

clj-kondo was my first real reason to use flycheck -- i suppose most other folks who use flycheck-clj-kondo are likely to be flycheck users already?

borkdude10:10:20

I just use flycheck, but I'm by no means an expert on how to use it

borkdude12:10:12

The lsp server should also work with emacs. Maybe with inspiration from @snoe's https://github.com/snoe/clojure-lsp#emacs code people can try it out and see if they can get it working on Windows, document it etc.

sogaiu13:10:36

i tried to get clojure-lsp to work with emacs before but didn't have much luck -- i wonder if things have changed...

snoe13:10:37

@sogaiu my coworker is using it with hydra and stuff setup for it. https://github.com/dpsutton/tangled/blob/master/init.org#lsp

borkdude13:10:46

@snoe If you would consider adopting clj-kondo into clojure-lsp, by borrowing some code from https://github.com/borkdude/clj-kondo.lsp it should just be a few lines of code.

borkdude13:10:13

no hard feelings if you don't of course!

borkdude13:10:47

also feedback on clj-kondo.lsp is welcome. this was my first time doing anything with lsp

sogaiu13:10:44

@snoe -- i will take a look -- just having failed again, happy to have more pointers 🙂

sogaiu14:10:27

ah, that config had some extra bits that the repository README seemed to be lacking -- seems to have done the trick -- thanks @snoe! at long last, i can try clojure-lsp 🙂

dominicm21:10:48

(:refer-clojure :rename {requirng-resolve rr}) clj-kondo didn't pick up that I typo'd the left-hand side here. Shall I raise an issue?

dominicm21:10:53

huh, wait. You don't actually seem to warn me if I :refer a non-existent var. I thought it did.

borkdude21:10:27

about clojure.core we know all the vars, but we don't know all the vars from other namespaces

dominicm21:10:38

unless in the cache?

borkdude21:10:48

right, but it should also work without the cache without giving false positives. it could try to be more clever about it, for sure

borkdude21:10:12

so if it's in the cache, it could try to help you

borkdude21:10:40

not sure if this will lead to many false positives, but definitely worth a try

borkdude21:10:56

also worth an issue