clojure-style-guide icon indicating copy to clipboard operation
clojure-style-guide copied to clipboard

A community coding style guide for the Clojure programming language

Results 48 clojure-style-guide issues
Sort by recently updated
recently updated
newest added

I was surprised this wasn't already in the style guide. This is a widely-agreed-upon idiom, right? Or am I just imagining things.

Consider two ways to check what sort of bird we have on hand: 1. `(= bird-type :toucan)` -- one reads this code as "bird type equals toucan" 2. `(= :toucan...

It seems fairly common to see `x & xs` in destructuring where `x` is some arbitrary "thing" and `xs` is a sequence of such "things". Yet the guide suggests `x`...

enhancement

https://guide.clojure.style/#bindings-alignment https://guide.clojure.style/#map-keys-alignment :thing1 & :thing2 have the same length. Use keys of different length in let & map alignment example, to make obvious that it's the keys to be aligned,...

enhancement

By my reading of https://github.com/bbatsov/clojure-style-guide#vertically-align-fn-args, we should indent `if` like so: ```clojure (if condition (f1) (f2)) ``` ...but that's contradicted by other examples in the guide, which use the common...

enhancement

When writing Clojure, I often will add a ? suffix to any boolean let bindings or defs. There is a strong convention of doing this for functions that return booleans....

Here's a preference I have that I think might be good for the style guide: ``` clojure ;; good (let [thing "stuff" other-thing "other stuff"] ...) ;; ok (let [thing...

After a long hiatus I'm finally trying to clean the backlog and improve the structure, examples and the rationale of the existing guidelines. I hope to get the document to...

maintainance

I disagree with "Indent each line of multi-line docstrings." This results in extra spaces inserted at arbitrary intervals in the resulting string, making docstring maintenance more of a pain -...

When threading a few calls single-argument calls that will fit within 80 characters, prefer a single line. ```clojure ;; good (-> x fizz :foo first frob) ;; not as good...