This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-21
Channels
- # announcements (51)
- # asami (5)
- # babashka (25)
- # babashka-sci-dev (26)
- # beginners (33)
- # calva (10)
- # clj-kondo (51)
- # clj-yaml (99)
- # clojure (96)
- # clojure-australia (3)
- # clojure-berlin (5)
- # clojure-europe (151)
- # clojure-norway (58)
- # clojurescript (20)
- # cursive (13)
- # datalevin (1)
- # datomic (19)
- # docker (6)
- # emacs (55)
- # events (1)
- # fulcro (50)
- # gratitude (8)
- # juxt (7)
- # leiningen (5)
- # malli (6)
- # membrane (1)
- # nbb (28)
- # off-topic (22)
- # pathom (7)
- # polylith (20)
- # portal (1)
- # reagent (37)
- # reitit (2)
- # releases (2)
- # reveal (32)
- # scittle (34)
- # shadow-cljs (46)
- # testing (10)
- # tools-deps (33)
- # xtdb (18)
Hey 👋 I must have changed something in my env but no idea what! In all Clojure files, Neovim now shows a warning about the namespace not matching the file name. I tried reinstalling Clj-kondo, purging the cache, ... can't seem to find the cure. This is purely an editor problem. Linting from the terminal doesn't output any warnings.
Latest v2022.09.08
Impossible to repro I'm afraid 😅
Perhaps @U7ERLH6JX could also check as he is also using nvim
It must be an env thing because I didn't update Clj-kondo meanwhile.
At first I thought it was maybe somehow due to installing clojure-lsp
but uninstalling it didn't help neither.
Even tried re-installing nvim... baffles me!
@UCFG3SDFV I think I know what it is
your nvim plugin likely lints via a temporary file or so and doesn't pass --filename
The plugin should do something like this: https://github.com/borkdude/flycheck-clj-kondo/blob/ff7bed2315755cfe02ef471edf522e27b78cd5ca/flycheck-clj-kondo.el#L67
What’s your linting setup @UCFG3SDFV ? You use something like null ls or nvim lint?
I've always been using Ale exactly like so: https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md#ale
On a side note, simply using lsp and clojure-lsp works for me for any file, don’t have a need for calling clj-kondo directly
Probably an issue in ALE. Trying to take a look
I did try re-installing the plugin. I sense installing clojure-lsp must have triggered some interference?
(although it is removed now)
If you have both lsp and clj kondo they could interfere I guess
but I've disabled diagnostics from clojure-lsp an purely rely on the installed clj-kondo
Makes sense.
@UCFG3SDFV do you still have the same error running with just lsp?
In any case lsp is now uninstalled, I purged the neovim/nvim-lspconfig
plugin, re-installed Ale, and still the same 😕
(I'm afraid to reinstall lsp now)
I don't see --filename here, that is likely the issue: https://github.com/dense-analysis/ale/blob/9b5a3581ebb7e6e1ccb0cbaeef5358aee57d734e/ale_linters/clojure/clj_kondo.vim
Yeah that’s what I was gonna say
But why was it working perfectly fine before?!
im not using ALE for quite a while now, quite hard to debug too
but its quite old too
yeah i think this is the issue ^
this PR being unmerged is whats keeping it from working as expected
@U04V15CAJ I guess you must be right, that looks like a very plausible explanation and maybe I wasn't as up-to-date as I thought
@UCFG3SDFV maybe the workaround could be not using the ALE for clojure and using lsp? not sure when they could address the issue in ALE.
@U7ERLH6JX Yes, I thought the issue might have been caused by lsp but it turns out it's the opposite (ale) Thanks to both of you, that was really helpful!
@UCFG3SDFV just to close this off, https://github.com/mfussenegger/nvim-lint/blob/master/lua/lint/linters/clj-kondo.lua#L16 is how it should work. this is the bit i contributed to the plugin too and then switching to just using lsp :rolling_on_the_floor_laughing:
Well I followed your path eventually and everything is perfect now!
nice! just as a side note, if its not too much work to move and since youre on nvim, i could recommend using https://github.com/mfussenegger/nvim-lint or https://github.com/jose-elias-alvarez/null-ls.nvim if you need something more than what the lsp can do. they are easier to debug and augment the built-in lsp mechanism nvim has, working with nvim-lspconfig