-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fix-stylish-haskell script (#444)
slightly adapted from plutus repo. --------- Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com> Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
- Loading branch information
1 parent
18d9bc9
commit a476b84
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ writeScriptBin, git, fd, stylish-haskell }: | ||
|
||
writeScriptBin "fix-stylish-haskell" '' | ||
${git}/bin/git diff > pre-stylish.diff | ||
${fd}/bin/fd --extension hs "$@" \ | ||
--exec ${stylish-haskell}/bin/stylish-haskell -i {} | ||
${git}/bin/git diff > post-stylish.diff | ||
diff pre-stylish.diff post-stylish.diff > /dev/null | ||
if [ $? != 0 ] | ||
then | ||
echo "Changes by stylish have been made. Please commit them." | ||
else | ||
echo "No stylish changes were made." | ||
fi | ||
rm pre-stylish.diff post-stylish.diff | ||
exit | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters