This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-03
Channels
- # adventofcode (91)
- # announcements (7)
- # aws (3)
- # babashka (69)
- # beginners (46)
- # calva (30)
- # cider (12)
- # clj-kondo (88)
- # cljs-dev (11)
- # cljsrn (1)
- # clojure (195)
- # clojure-dev (21)
- # clojure-europe (2)
- # clojure-italy (13)
- # clojure-nl (56)
- # clojure-spec (4)
- # clojure-sweden (6)
- # clojure-uk (27)
- # clojurescript (179)
- # core-async (2)
- # cryogen (1)
- # cursive (2)
- # data-science (1)
- # datomic (57)
- # fulcro (15)
- # graalvm (9)
- # instaparse (6)
- # joker (18)
- # juxt (9)
- # leiningen (6)
- # off-topic (20)
- # other-languages (10)
- # pathom (5)
- # re-frame (20)
- # reitit (2)
- # rewrite-clj (5)
- # shadow-cljs (78)
- # sql (34)
- # tools-deps (128)
- # uncomplicate (16)
- # vim (6)
The highlighting seems a bit different with the LSP server. Notice how the locals are highlighted along with the adjacent bracket. But the underlining is correct. Is it something that could be fixed on clj-kondo's side, or is it an issue with LSP?
I'm not too familiar with the plugin itself. I don't even know how to build it: https://github.com/gtache/intellij-lsp/issues/122
But I think it's possible to build a standalone IntelliJ plugin from it. So if there will be someone stepping up and tweaking the necessary stuff, it can be a better experience maybe. And there can be a clj-kondo IntelliJ extension in the Jetbrains marketplace
hello, I'm running into linter error, but I don't understand why,
can't parse name_of_file.clj, no conversion to symbol
someone here can give me a hint?
I'm running:
clj-kondo --lint src --config '{:output {:format :json}}'
into a repositorythe linter is accusing this can't parse for every file on the repository
and joker does not give me any error
@d.ian.b can you make a repro that I can run locally? using the information you gave me I still can't reproduce it
clj-kondo version: 2019.11.23-1
OS, both in ubuntu and manjaro
the can't parse error is thrown here: https://github.com/borkdude/clj-kondo/blob/2889dff5f3a1d5691ca17e81ab33d624a3376d3d/src/clj_kondo/impl/analyzer.clj#L1479
I'll see here this
I don't know where the -1 comes from in the version. I didn't release that: https://github.com/borkdude/clj-kondo/releases
it's only for the OS, has no relation to what you have released 🙂 which is 2019.11.23
It's useful if the package meta around the release has changed, i.e., maybe a new depends or arch or url, but the underlying version of the package is the same, i.e., if you where to change the URL to '
then I would change the pkgrel to 2, but keep the pkgver to 2019.11.23, so then what would be installed would be 2019.11.23-2
@d.ian.b and if possible, try to isolate the case to the smallest piece of code that still triggers the error for you and post it here.
I'll try this
@d.ian.b Do you get the same error when you try to lint an empty file, e.g. put an empty file src/foo.clj in your project
it passes =<
I couldn't reproduce the error =<
will try
it passes =<
foo does not in the error
but other namespaces are in error
every one another
every file
can you paste code from such a file into foo.clj and then see if that produces the error?
and if so, remove some code, lint again, until you see no error, and paste the smallest bit of code that still produced the error
it happens when I add (ns folder.foo)
src/folder/foo.clj:0:0: error: can't parse src/folder/foo.clj, no conversion to symbol
I have deps.edn src/folder/foo.clj
seems to work just fine here:
$ clj-kondo --lint - <<< '(ns folder.foo) (inc)'
<stdin>:1:17: error: clojure.core/inc is called with 0 args but expects 1
linting took 10ms, errors: 1, warnings: 0
clj-kondo --lint - <<< '(ns folder.foo) (inc)' <stdin>:0:0: error: can't parse <stdin>, no conversion to symbol linting took 4ms, errors: 1, warnings: 0
CLJ_KONDO_DEV=true clj-kondo --lint src/folder/foo.clj src/folder/foo.clj:0:0: error: can't parse src/folder/foo.clj, no conversion to symbol linting took 4ms, errors: 1, warnings: 0
clj-kondo v2019.11.23
Can you try the same command but from a new directory in /tmp
, like mkdir -p /tmp/foo && cd /tmp/foo &&
CLJ_KONDO_DEV=true clj-kondo --lint - <<< '(ns folder.foo) (inc)'
worked
mkdir -p /tmp/foo && cd /tmp/foo && clj-kondo --lint - <<< '(ns folder.foo) (inc)' <stdin>:1:17: error: clojure.core/inc is called with 0 args but expects 1 linting took 8ms, errors: 1, warnings: 0
do you know why?
Can you move aside the configuration you have in .clj-kondo/config.edn
to .clj-kondo/config.bak
the problem was my config.edn
{:lint-as {folder.test.integrant/with-system when-let}}
this was the config
thanks!
thanks
OK, I'll try =)
I wonder if something like (def x (function-call ...))
should be linted
the amount oif hours wasted because of weird behaviours of things that should have been a defn
but were a def
is incredible
and they are usually bugs that only happen after a while in specific conditions, so if it's not actually a "simple" constant, should you really use def?
@andrea.crotti I do that quite often
well in many cases it's safe to do so
(def init-in (fn []
#?(:clj (-> (.StringReader. "")
clojure.lang.LineNumberingPushbackReader.))))
(def init-out (fn [] (new #?(:clj .StringWriter
:cljs goog.string/StringBuffer))))
(def init-err (fn [] #?(:clj (.StringWriter.))))
(def in (vars/dynamic-var '*in* (init-in)))
(def out (vars/dynamic-var '*out* (init-out)))
(def err (vars/dynamic-var '*err* (init-err)))
but when it's not you can end up with some really weird bugs
I was taking more about things like (def truncate-db (jdbc/execute conn "TRUNCATE TABLE x"))
which in this case it's clearly a problem of course, but it's not always so clear
yeah it's tricky
@borkdude could you do some linting for hodur files?
it's another request 😃
I need examples of what's currently not linted correctly about this library in a Github issue. Input + current errors + expected solutions.
ok, I'll do it later! 😃