Skip to content

Clarify if indentation #229

Open
Open
@gpind

Description

@gpind

By my reading of https://github.com/bbatsov/clojure-style-guide#vertically-align-fn-args, we should indent if like so:

(if condition
    (f1)
    (f2))

...but that's contradicted by other examples in the guide, which use the common two-space indentation for if. Technically the rule might not cover if since it's a special form and not a macro, but there's also if-let and if-some and it would be very weird IMO to indent them differently. It would be good to mention this explicitly, even if just to call out if and friends as exceptions.

(I searched for existing issues covering this, but the closest I found was #87.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions