New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

parindent

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parindent

__[Try it online](https://shaunlebron.github.io/parindent/)__

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Parindent

Try it online

WIP public prototype— Indent Clojure files based on the following discussions:

Current Rules

  1. ALLOW - 1-space, 2-space, or Arg-alignment (user preference determined by first sibling line)
  2. ENFORCE - vertically aligned sibling lines
  3. 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.

FAQs

Package last updated on 17 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc