Fourmolu fixup (#1326)

Switch to `fourmolu-0.13` and reformat all source code.
This commit is contained in:
Karl Ostmo 2023-07-12 11:00:23 -07:00 committed by GitHub
parent 8548e4f296
commit 485e6ace1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 9 deletions

View File

@ -1,6 +1,6 @@
restylers_version: stable
restylers:
- fourmolu:
image: 'restyled/restyler-fourmolu:v0.10.1.0'
image: 'restyled/restyler-fourmolu:v0.13.0.0'
arguments:
[]

View File

@ -216,7 +216,7 @@ them!
#### Formatting style
We use [`fourmolu-0.10.1.0`](https://hackage.haskell.org/package/fourmolu)
We use [`fourmolu-0.13.0.0`](https://hackage.haskell.org/package/fourmolu)
with a [custom
configuration](https://github.com/swarm-game/swarm/blob/main/fourmolu.yaml)
for formatting Haskell code.
@ -224,7 +224,7 @@ for formatting Haskell code.
To install the formatter, run:
```bash
cabal install fourmolu-0.10.1.0
cabal install fourmolu-0.13.0.0
```
If this installation does not work, you may have to set your GHC to a version supported by `fourmolu`:
@ -241,7 +241,7 @@ ghcup set ghc 9.4.5
You can run the formatter from the shell:
```bash
cd path/to/the/root/of/swarm/repo
find src/ app/ test/ -name "*.hs" | xargs fourmolu --mode=inplace
fourmolu --mode=inplace src app test
```
For convenience, one may alternatively execute this script:

View File

@ -5,6 +5,9 @@ indent-wheres: false # 'false' means save space by only half-indenting the 'wher
diff-friendly-import-export: true
let-style: inline
respectful: true
single-constraint-parens: false
single-constraint-parens: auto
haddock-style: single-line
newlines-between-decls: 1
reexports:
- module Text.Megaparsec exports Control.Applicative
- module Options.Applicative exports Control.Applicative

View File

@ -3,4 +3,4 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR/..
find src/ app/ test/ -name "*.hs" | xargs fourmolu --mode=inplace
fourmolu --mode=inplace src app test

View File

@ -97,7 +97,7 @@ instance FromJSONE (EntityMap, RobotMap) (AugmentedCell Entity) where
AugmentedCell
<$> liftE (v .:? "waypoint")
<*> v
..: "cell"
..: "cell"
------------------------------------------------------------
-- World editor

View File

@ -36,7 +36,7 @@ instance FromJSONE (EntityMap, RobotMap) (NamedStructure (Maybe (PCell Entity)))
sName <- liftE $ v .: "name"
NamedStructure sName
<$> v
..: "structure"
..: "structure"
data PStructure c = Structure
{ area :: [[c]]

View File

@ -72,7 +72,7 @@ displayEntityCell worldEditor g coords =
e
`hasProperty` Known
|| (e ^. entityName)
`elem` (g ^. knownEntities)
`elem` (g ^. knownEntities)
|| case hidingMode g of
HideAllEntities -> False
HideNoEntity -> True