mirror of
https://github.com/swarm-game/swarm.git
synced 2024-10-03 19:17:31 +03:00
Fourmolu fixup (#1326)
Switch to `fourmolu-0.13` and reformat all source code.
This commit is contained in:
parent
8548e4f296
commit
485e6ace1f
@ -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:
|
||||
[]
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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
|
@ -97,7 +97,7 @@ instance FromJSONE (EntityMap, RobotMap) (AugmentedCell Entity) where
|
||||
AugmentedCell
|
||||
<$> liftE (v .:? "waypoint")
|
||||
<*> v
|
||||
..: "cell"
|
||||
..: "cell"
|
||||
|
||||
------------------------------------------------------------
|
||||
-- World editor
|
||||
|
@ -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]]
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user