Skip to content

Commit 2c06471

Browse files
authored
Introduce fourmolu (#1500)
Fixes #1499 # PR description This PR introduces `fourmolu` as an automatic code formatter to replace `stylish-haskell` Beyond the actual reformatting, I've introduced the following changes: - add `fourmolu` to the Nix shell - add the `scripts/ci/run-fourmolu.sh` scripts, which is based on the previously used script for `stylish-haskell` - add a Hydra job to check the project with `fourmolu` (and pushed a dummy commit to check that the CI rejects improperly styled code) - add The Big Reformatting Commit to `.git-blame-ignore-revs` and checked that the blame interface on GitHub respects it - with a somewhat heavy heart, butchered the style guide. The layout-related sections are removed as the layout is now enforced by `fourmolu`. Additionally, I've enabled `ImportQualifiedPost` in all cabal files, alongside with the `-Wprepositive-qualified-module` warning. This extension and warning could be removed once (if?) we transition to `GHC2021` as the default language.
2 parents d582af5 + a92669f commit 2c06471

File tree

664 files changed

+98957
-87853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

664 files changed

+98957
-87853
lines changed

.git-blame-ignore-revs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### NOTE
2+
# Run `git config blame.ignoreRevsFile .git-blame-ignore-revs`
3+
# from the repository's root to tell `git blame` to ignore
4+
# the commits below.
5+
6+
# 2025
7+
########################################
8+
# Format with fourmolu
9+
70c3258667611a12f7fa8f85b5591830c533d296

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,19 @@ and improvements are always welcome.
203203

204204
## Formatting the code
205205

206-
We use `stylish-haskell` 0.14.6.0 for Haskell code formatting.
206+
We use `fourmolu` for Haskell code formatting. See [tools.nix](./nix/tools.nix) for the `fourmolu` version used in CI.
207207

208208
Either enable editor integration or call the script used by CI itself:
209209

210210
```bash
211-
./scripts/ci/run-stylish.sh
211+
./scripts/ci/run-fourmolu.sh
212212
```
213213

214214
When using Nix, you can use the following command, which will build and use
215-
the right version of `stylish-haskell`.
215+
the right version of `fourmolu`.
216216

217217
```bash
218-
nix develop -c ./scripts/ci/run-stylish.sh
218+
nix develop -c ./scripts/ci/run-fourmolu.sh
219219
```
220220

221221
# Generating documentation and setting up hoogle

0 commit comments

Comments
 (0)