clj-kondo

dotemacs 2026-05-07T11:15:12.811749Z

Hello In a PR review, got asked to amend a :require clause, where each required namespace should be on its own line. Looking at Clojure Style guide about it: https://github.com/bbatsov/clojure-style-guide#namespace-segments-limit Is this something clj-kondo would consider as a built-in style linter, or should it remain a project-local hook? For example, flag this:

(:require [clojure.string :as str] [foo.bar.baz :as quux]
and not this:
(:require [clojure.string :as str])
Thanks

dotemacs 2026-05-07T11:16:11.230109Z

I have the code for the hook, so the question is more: would you consider this as feature I should create a PR for? Thanks

borkdude 2026-05-07T11:18:19.275839Z

I think this probably more belongs in cljfmt?

dotemacs 2026-05-07T11:20:43.185659Z

But doesn’t cljfmt format the code? I just want this linter to say “Hey that line… yea, yea, that one! It’s a bit off.”

borkdude 2026-05-07T11:22:52.644599Z

cljfmt not only formats the code, but can also check it

borkdude 2026-05-07T11:23:43.434969Z

not sure if it has ns-specific things. let's ask @ericdallo how clojure-lsp fixes ns forms

ericdallo 2026-05-07T11:25:42.765339Z

Clojure-lsp manually fixes using rewrite-clj, and has options to requires be in 2 different ways

dotemacs 2026-05-07T11:27:14.066179Z

The thing is, can this just be optional, so that the users can turn on/off? Because if you add it to the project, which is large and it didn’t have this on… it can get noisy.

ericdallo 2026-05-07T11:32:02.843469Z

I agree this could be a linter yes, what we do in nubank and other places is to run clojure-lsp diagnostics + clojure-lsp clean-ns which will report if the ns is not following the standard, so having this as a linter would help with having that built-in in diagnostics

dotemacs 2026-05-07T11:34:41.806039Z

So is this worth adding to clj-kondo, seeing as that is being used for the project I’m on? Thanks

borkdude 2026-05-07T11:36:18.945159Z

I'm not directly opposed, I'm just a bit worried that this will lead to formatting-related linters for all kinds of macros which then eventually will turn into what cljfmt already is

ericdallo 2026-05-07T11:37:01.962129Z

that's true as well, but cljfmt doesn't have the concept of diagnostic, so for me the best place for this is kondo for specifically this one

ericdallo 2026-05-07T11:37:52.699449Z

we could have a clojure-lsp built-in linter as well, but since this doesn't depend on anything from project, clj-kondo would fit best

borkdude 2026-05-07T11:40:02.777339Z

alright PR welcome

🤸‍♂️ 1
dotemacs 2026-05-07T15:11:25.595019Z

The PR is here: https://github.com/clj-kondo/clj-kondo/pull/2834 forgot to update the thread, thanks

borkdude 2026-05-07T15:12:55.022149Z

I saw it, but I'm swamped with bb conf and DCD this week/end so I'll look at it later. thanks!

dotemacs 2026-05-07T15:13:16.099489Z

All good, no rush, thank you

🙏 1