aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-04 12:49:14 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-04 12:49:14 +0100
commit0edfbf1478950d645ece19ced0156771ba16ebb6 (patch)
treeb0598dc9e2ced115952982460a9884e39bc20b51 /tools
parent17ce81306043b14a67f3af40f77e5f860ffc4719 (diff)
downloadpandoc-0edfbf1478950d645ece19ced0156771ba16ebb6.tar.gz
Added 'make refactor' using hlint, stylish-haskell.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/refactor.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/refactor.sh b/tools/refactor.sh
new file mode 100755
index 000000000..40e3c964e
--- /dev/null
+++ b/tools/refactor.sh
@@ -0,0 +1,8 @@
+cppdir=`stack path --dist-dir`/build/autogen
+for f in $*
+do
+ echo "Applying hlint --refactor to $f"
+ hlint --refactor -i --cpp-file=$cppdir/cabal_macros.h $f >/dev/null
+ echo "Applying stylish-haskell to $f"
+ stylish-haskell -i $f | perl -ne 'if (/./) { print "\n" x $n, $_; $n = 0 } else { $n++ }' >/dev/null
+done