NOTE: experimental
Quickly undo Parinfer formatting on unchanged top-level forms. (using the original formatting found in git HEAD
)
Helps you minimize diffs when working on teams that don’t use Parinfer or Parlinter.
npm install -g parstager
parstager src # 1. clean src/ files of some parinfer changes
git add src # 2. stage src/
git commit -m 'my changes' # 3. commit changes
When working on teams that don’t use Parinfer, diffs can be quite large. Parstager helps me isolate diffs to only the functions which I have changed:
Original file | Edited with Parinfer | Cleaned by Parstager |
---|---|---|
(ns user
(:require
[clojure.string :as str]
))
(defn add-nums
([a b]
(+ a b))
([a b c]
(+ a b c))
)
(defn add-strs
([a b]
(str a b))
([a b c]
(str a b c))
)
(comment
(add-nums 1 2 3)
(add-strs "a" "b")
; put more examples here
) |
(ns user
(:require
[clojure.string :as str]))
(defn add-nums
([a b]
(+ a b))
([a b c]
(+ a b c)))
(defn add-strs
([a b]
(str a b))
([a b c]
(str a b c))
([a b c d]
(str a b c d)))
(comment
(add-nums 1 2 3)
(add-strs "a" "b"))
; put more examples here
|
(ns user
(:require
[clojure.string :as str]
))
(defn add-nums
([a b]
(+ a b))
([a b c]
(+ a b c))
)
(defn add-strs
([a b]
(str a b))
([a b c]
(str a b c))
([a b c d]
(str a b c d)))
(comment
(add-nums 1 2 3)
(add-strs "a" "b")
; put more examples here
) |
@@ -1,25 +1,27 @@
(ns user
(:require
- [clojure.string :as str]
- ))
+ [clojure.string :as str]))
+
(defn add-nums
([a b]
- (+ a b))
+ (+ a b))
([a b c]
- (+ a b c))
- )
+ (+ a b c)))
+
(defn add-strs
([a b]
- (str a b))
+ (str a b))
([a b c]
- (str a b c))
- )
+ (str a b c))
+ ([a b c d]
+ (str a b c d)))
+
(comment
(add-nums 1 2 3)
- (add-strs "a" "b")
+ (add-strs "a" "b"))
; put more examples here
- )
+ |
@@ -12,10 +12,12 @@
(defn add-strs
([a b]
- (str a b))
+ (str a b))
([a b c]
- (str a b c))
- )
+ (str a b c))
+ ([a b c d]
+ (str a b c d)))
+ |