clj-kondo

simongray 2025-08-25T09:05:31.299849Z

Can I make clj-kondo ignore whitespace? I am trying to use clojure-mcp, but the whitespace changes that are introduced by the auto-linting (which seems to be clj-kondo) conflict directly with the way IntelliJ does vertical alignment of maps and comments. I have looked at the docs and can't find anything relating to whitespace, indentation, etc.

borkdude 2025-08-25T09:06:05.496989Z

clj-kondo has always ignored whitespace, it doesn't do anything with whitespace whatsoever

simongray 2025-08-25T09:06:13.365889Z

Hm, strange

simongray 2025-08-25T09:06:21.074059Z

I wonder where that is coming from then

borkdude 2025-08-25T09:06:32.782559Z

maybe it uses cljfmt or some other tool?

simongray 2025-08-25T09:07:28.742919Z

Ah! I'll go check. I have zero experience with any of these libs, since I always just relied in IntelliJ's formatting πŸ™‚

simongray 2025-08-25T09:07:32.758769Z

thanks

borkdude 2025-08-25T09:08:17.720689Z

well maybe ask in #ai-assisted-coding where the clojure-mcp talk is happening, seems to be the best place to start?

simongray 2025-08-25T09:11:31.508919Z

Yeah, you're right (and I did). I just took a wrong turn πŸ™‚

dpsutton 2025-08-25T13:23:22.462139Z

linting doesn’t introduce anything. it lints existing. However, clojure-mcp often reformats lots of buffers. An easy way to fix this is with a linter, or you can compute a diff of non-whitespace changes, commit those, and then revert the remaining changes

borkdude 2025-08-25T13:24:39.905589Z

> However, clojure-mcp often reformats lots of buffers. An easy way to fix this is with a linter ?

dpsutton 2025-08-25T13:24:59.403109Z

good question. totally meant formatter

πŸ‘ 1
souenzzo 2025-08-25T10:13:20.882869Z

My kondo was reporting error: Unresolved symbol: background and I fixed it by replacing [midje.sweet :refer :all] with [midje.sweet :refer [background]] Is this bug known?

borkdude 2025-08-25T10:14:07.925979Z

It's a known limitation of clj-kondo. Unless you lint midje.sweet and it has a sane way of defining background, clj-kondo can't know that that namespace contains that var

πŸ‘ 1
borkdude 2025-08-25T10:14:40.100299Z

how are you using clj-kondo?

souenzzo 2025-08-25T10:24:41.737079Z

can i open a bug asking it in kondo repository and then you answer and close? I searched midje, refer, all in kondo repo and I couldn't find this answer I already knew about this limitation, but I didn't find a closed bug to support my knowledge.

borkdude 2025-08-25T10:25:20.885979Z

this isn't specific to midje

borkdude 2025-08-25T10:25:37.868349Z

> how are you using clj-kondo?

borkdude 2025-08-25T10:27:10.210399Z

I mean, from the command line, editor, what editor, clojure-lsp, intellij?

souenzzo 2025-08-25T10:37:17.436689Z

kondo CLI directly, v2024.11.14

borkdude 2025-08-25T10:38:21.141249Z

ok. this issue should resolve itself when you lint the dependencies with:

clj-kondo --lint "$(clojure -Spath)" --dependencies --parallel --copy-configs
copy configs is optional, but this is what you would typically invoke when setting up clj-kondo with dependency analysis

Shantanu Kumar 2025-08-25T13:19:42.133859Z

I see a cyclic dependency reported (due to :require-macros) in a CLJC file for such ns declaration:

(ns foo.core.util
  (:require [clojure.string :as str])
  #?(:clj (:import [clojure.lang ExceptionInfo])
     :cljs (:require-macros [foo.core.util])))
The code runs fine, so it seems like a buggy flagging on clj-kondo part. Am I missing something?

borkdude 2025-08-25T13:20:38.577039Z

This is not a clj-kondo linter, but something implemented by #lsp - better to report it over there

πŸ‘πŸ½ 1