Skip to content

Commit

Permalink
Make code reformatting command a script in the repo (#875)
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo authored Nov 22, 2022
1 parent 21bf676 commit ef31834
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ cd path/to/the/root/of/swarm/repo
find src/ app/ test/ -name "*.hs" | xargs fourmolu --mode=inplace --cabal-default-extensions
```

For convenience, one may alternatively execute this script:
```
scripts/reformat-code.sh
```

There is probably a way to configure your favorite editor to have `fourmolu`
automatically applied to your code; but if you don't know how to set that up,
don't worry! The [`restyled.io` bot](https://restyled.io/) automatically
Expand Down
6 changes: 6 additions & 0 deletions scripts/reformat-code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR/..

find src/ app/ test/ -name "*.hs" | xargs fourmolu --mode=inplace --cabal-default-extensions

0 comments on commit ef31834

Please sign in to comment.