This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-04
Channels
- # announcements (7)
- # babashka (26)
- # babashka-sci-dev (19)
- # beginners (66)
- # calva (4)
- # clj-kondo (55)
- # cljs-dev (173)
- # cljsrn (17)
- # clojure (86)
- # clojure-art (3)
- # clojure-australia (1)
- # clojure-europe (24)
- # clojure-india (1)
- # clojure-nl (3)
- # clojure-uk (6)
- # clojured (5)
- # clojurescript (39)
- # cursive (8)
- # data-oriented-programming (20)
- # datomic (9)
- # emacs (10)
- # events (1)
- # figwheel-main (16)
- # fulcro (33)
- # gratitude (1)
- # helix (2)
- # hugsql (2)
- # jobs (2)
- # kaocha (4)
- # leiningen (5)
- # lsp (110)
- # malli (1)
- # missionary (17)
- # observability (3)
- # re-frame (10)
- # reagent (1)
- # reitit (7)
- # rewrite-clj (3)
- # shadow-cljs (63)
- # sql (19)
- # tools-build (74)
- # tools-deps (32)
- # transit (1)
- # xtdb (5)
re https://github.com/clj-kondo/clj-kondo/issues/1560 i’m still wondering about that switch to control the warning on private tasks. given
{:tasks
{-a {:doc "private"}
b {:doc "public"
:depends [-a]}}}
bb tasks
gives
> bb tasks
The following tasks are available:
b public
personally, my main reason for having clj-kondo remind me to provide doc strings is so task info will be available on the shell… :doc
being used by babashka for private tasks in any way?maybe default to no warning on private tasks then (and leave it at that for the first iteration)
@maximilian I think a nice addition could be to actually get linting in the task code.
The way this can be done is to wrap the task code as a function with :depends as the arguments
so {:task (+ a b c) :depends [a b c]} becomes (fn [a b c] (+ a b c))
and then lint that function
but this will cause unused function argument warnings... could also expand as (declare a b c) (+ a b c)
we can talk in #clj-kondo-dev about this as to not disturb anyone else with details about this
can kondo be configured to not lint library code? e.g:
clj-kondo only lints what you provide to it, so it depends on whatever tool calls clj-kondo
it's vscode + calva, and its really strange because it doesn't happen when first loading up a project
it only happens after being open for 1-2 hours
and then after restarting, it's fine for another hour or two
no it's just a project generated with lein new app [name]
, zero changes to the structure of the project - not even a new file
I think this happens indeed, when you open a external dependency the editor loads the content and add the file as a LSP workspace fie, to most navigation and other features work
I already faced this with multiple lsps, not only clojure, not sure how we could fix it
maybe don't return diagnostics when the file is external, but the issue is how we know a file is external, need some POC
yeah i asked in #calva and pez recommended asking here, so i'm not really sure where the problem lies. i'm definitely not adding any external dependencies, i don't even know how to do that yet, but i'm not sure if leiningen or calva are adding a dependency or something.
external dependencies == opening a file not from your project like clojure.core, clojure.string etc
i'm not opening core.clj at all as far as i know?
I'm out of clues, sorry, clj-kondo is a pretty simple tool: it lints what you tell it to.
i don't know clojure at all i'm in the process of trying to learn so i probably can't help as much as i'd like to but here's exactly what i've done:
1. i generated a new project with lein new app clojure-noob
2. i opened the directory it created in vscode
3. i opened a repl
4. the error shows up an hour or two later
it makes sense if it's not a kondo issue but i don't see how this could possibly be expected behaviour?
unless i'm misunderstanding what that means lol
but thank you for your help either way
for sure it's not expected if you didn't open a file, but I think you did at some point
hang on i'm being dumb here, i've only just realised that core.clj is the "main" file so yeah i am opening it
thats the file i'm working in
but these errors and warnings are not corresponding to anything inside the actual file
are you sure? core.clj from your project and core.clj from clojure.core are different file. from your print it seems you opened clojure.core, maybe finding a definition of some function or something
this is the only file i've ever opened since starting to learn clojure in this project:
however you make a good point, maybe this is happening when i hover my mouse over a function and it shows the doc?
it should not, we only lint when we open the file or itś a project file when starting lsp
weird. well, until i figure out exactly what action is making this happen this is probably just wasting your time so i'll just keep an eye on it for now until i figure it out
thank you for your help
no problem, feel free to start with a issue on Calva, the entrypoint, where we can debug and find the root cause
Because of go to definitions and stuff like that, I often open the clojure.core file, and this brings a lot of clj kondo issues:
I'm having the same problem, but it only started a few days ago, possibly after latest Calva update. The errors are coming from clojure.core, which shouldn't be linted, as I haven't opened. They can be triggered by random changes in my code: deletion of a line, beginning a new form, etc. I have been using Calva for quite a while and first encountered this only a few days ago.
this probably started to happen after we fixed on clojure-lsp the find definition of a jar, I think we can not return lint for jar dependencies, I'll do the proper changes on clojure-lsp side
@U2CR1J4UV @UGC0NEP4Y @UH1SWK753 I just made a https://github.com/clojure-lsp/clojure-lsp/commit/4ef029d85d05bb4be435cdeb38fa538d33eadbecstopping linting external files which solve this issue, it should be available on next clojure-lsp release, if you wanna test it locally, you can clone the repo and run make
to generate a local clojure-lsp