This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-19
Channels
- # adventofcode (1)
- # announcements (3)
- # babashka (60)
- # beginners (60)
- # calva (5)
- # clj-commons (17)
- # clj-kondo (33)
- # clj-on-windows (1)
- # clojure (40)
- # clojure-austin (3)
- # clojure-europe (19)
- # clojure-gamedev (25)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-sweden (4)
- # clojure-uk (2)
- # clojurescript (27)
- # conjure (1)
- # core-async (1)
- # core-typed (7)
- # cursive (5)
- # datomic (35)
- # events (1)
- # fulcro (35)
- # integrant (7)
- # introduce-yourself (2)
- # kaocha (5)
- # leiningen (2)
- # lsp (26)
- # malli (13)
- # nbb (99)
- # off-topic (15)
- # pathom (12)
- # pedestal (5)
- # polylith (8)
- # portal (4)
- # rdf (19)
- # reagent (8)
- # reitit (5)
- # releases (2)
- # remote-jobs (2)
- # rewrite-clj (1)
- # shadow-cljs (94)
- # testing (2)
- # timbre (2)
- # tools-deps (16)
I opened an issue about adding a linter from eastwood to clj-kondo. Would you (borkdude) be interested in adding other linters from eastwood and kibit?
Cool, thanks
I'm using vscode to edit let-go files, which are mostly valid Clojure. I get Can't parse myfile.lg, No matching clause: :unknown [Ln 1, Col 1]
from clj-kondo(syntax) in almost every file, regardless of the content, always on the first line. It only happens when the files have .lg
extension - I've associated it with Clojure though. Is there a way to make clj-kondo respect .lg 🙂?
1. make sure your VSCode global settings.json
has the following set:
"files.associations": {
"*.lg": "clojure"
},
2. create an empty folder and open it in fresh VSCode window,
3. create and open file foo.lg
4. In foo.lg
paste
(ns foo)
(println 1)
result:In emacs it works fine when I enter clojure-mode
this is because flycheck-clj-kondo derives the language fallback from the mode you're in
https://github.com/borkdude/flycheck-clj-kondo/blob/ff7bed2315755cfe02ef471edf522e27b78cd5ca/flycheck-clj-kondo.el#L88-L91
but I'll make clj-kondo more lenient that when the language is unknown it falls back to clojure
O wait, this is already the case:
$ clj-kondo --lint /tmp/foo.lg
/tmp/foo.lg:5:1: error: Unresolved symbol: x
I suspect that clojure-lsp is passing lang
as lg
or so:
$ clj-kondo --lint /tmp/foo.lg --lang lg
/tmp/foo.lg:0:0: error: Can't parse /tmp/foo.lg, No matching clause: :lg
It should just not pass --lang
if it's something unknown. cc @UKFSJSM38
Fixed on master, it will only pass lang if not unknown, available on nightly build
it looks to me like I'm getting from the new :unused-value
linter on a macro from a library I'm using. specifically this one: https://github.com/ptaoussanis/nippy/blob/a2e03bef5e3aaabb1351367085334cf8feadcd06/src/taoensso/nippy.clj#L1939-L1968
maybe :unused-value
should be disabled for things inside macros?
sorry, I'm not able to reproduce it outside of the project it's in: https://github.com/skynet-gh/skylobby/blob/master/graal/clj/skylobby/core.clj#L37-L39
$ clj-kondo --lint graal/clj/skylobby/core.clj | grep Unused
graal/clj/skylobby/core.clj:37:3: info: Unused value
graal/clj/skylobby/core.clj:43:3: info: Unused value
it must be something weird with my setupIt does seem to be related to the config, when I move it aside the warning disappears. Looking further
It seems that dtype-next provides a config for nippy, that's not how things should work :)
but then again, I think it's also probably better to ignore unused values generated by macros
oh, I should probably fix that and gitignore those other files in .clj-kondo
right? I've started using this .gitignore
in .clj-kondo
folder on new projects:
*
!.gitignore
!config.edn