From 0edfbf1478950d645ece19ced0156771ba16ebb6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 4 Mar 2017 12:49:14 +0100 Subject: Added 'make refactor' using hlint, stylish-haskell. --- tools/refactor.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 tools/refactor.sh (limited to 'tools') 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 -- cgit v1.2.3