You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ALLOW - 1-space, 2-space, or Arg-alignment (user preference determined by first sibling line)
ENFORCE - vertically aligned sibling lines
ENFORCE - indentation after a paren should imply containment
Friction
Staggered indentation of siblings not allowed:
(cond
foo
- bar+ bar
baz
- qux)+ qux)
Cannot indent past an open-paren unless contained inside it (Parinfer):
(defn foo
([a b]
- (+ a b))+ (+ a b))
([a b c]
- (+ a b c)))+ (+ a b c)))
Install
npm install -g parindent
Try it
To indent all your files in place, run from your project root:
parindent '**/*.{clj,cljs,cljc}' --write
Usage
$ parindent
Usage: parindent [opts] [filename ...]
A minimal indenter for Lisp code (e.g. Clojure)
Available options:
--write Edit the file in-place. (Beware!)
--list-different or -l Print filenames of files that are different from Parindent formatting.
--stdin Read input from stdin.
--version or -v Print Parindent version.
About
prototype for standardizing indentation in clojure files