Skip to content

Commit 0272c81

Browse files
committed
before formatting everything
1 parent 14c06ac commit 0272c81

File tree

5 files changed

+46
-55
lines changed

5 files changed

+46
-55
lines changed

.stylish-haskell.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

fourmolu.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
indentation: 2
33

44
# Max line length for automatic line breaking
5-
column-limit: 100
5+
column-limit: none
66

77
# Styling of arrows in type signatures (choices: trailing, leading, or leading-args)
88
function-arrows: leading
@@ -14,19 +14,19 @@ comma-style: leading
1414
import-export-style: diff-friendly
1515

1616
# Whether to full-indent or half-indent 'where' bindings past the preceding body
17-
indent-wheres: false
17+
indent-wheres: true
1818

1919
# Whether to leave a space before an opening record brace
20-
record-brace-space: false
20+
record-brace-space: true
2121

2222
# Number of spaces between top-level declarations
2323
newlines-between-decls: 1
2424

2525
# How to print Haddock comments (choices: single-line, multi-line, or multi-line-compact)
26-
haddock-style: multi-line-compact
26+
haddock-style: multi-line
2727

2828
# How to print module docstring
29-
haddock-style-module: null
29+
haddock-style-module: multi-line
3030

3131
# Styling of let blocks (choices: auto, inline, newline, or mixed)
3232
let-style: auto
@@ -35,10 +35,10 @@ let-style: auto
3535
in-style: right-align
3636

3737
# Whether to put parentheses around a single constraint (choices: auto, always, or never)
38-
single-constraint-parens: always
38+
single-constraint-parens: never
3939

4040
# Whether to put parentheses around a single deriving class (choices: auto, always, or never)
41-
single-deriving-parens: auto
41+
single-deriving-parens: always
4242

4343
# Output Unicode syntax (choices: detect, always, or never)
4444
unicode: never

nix/fourmolu.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# We maintain a fork of fourmolu that fixes some issues with the upstream version.
2+
3+
{ pkgs, lib }:
4+
5+
ghc:
6+
7+
let
8+
fourmolu-project = pkgs.haskell-nix.cabalProject' {
9+
src = pkgs.fetchFromGitHub {
10+
owner = "zeme-wana";
11+
repo = "fourmolu";
12+
rev = "3644b248a6ce19a85cce46edb20f5de08cb7546a";
13+
sha256 = "sha256-zyEkx4oKHQepPb+52dNVkg93SZHWeVf6JqM5WFOmqJE=";
14+
};
15+
compiler-nix-name = ghc;
16+
};
17+
in
18+
19+
fourmolu-project.hsPkgs.fourmolu.components.exes.fourmolu

nix/outputs.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ let
3232
project = import ./project.nix
3333
{ inherit inputs pkgs lib metatheory r-with-packages utils; };
3434

35+
mkFourmolu = import ./fourmolu.nix
36+
{ inherit pkgs lib; };
37+
3538
mkShell = project: import ./shell.nix
36-
{ inherit inputs pkgs lib project agda-tools metatheory r-with-packages; };
39+
{ inherit inputs pkgs lib project agda-tools metatheory r-with-packages mkFourmolu; };
3740

3841
exposed-haskell-packages = {
3942
plutus-core-test = project.flake'.packages."plutus-core:test:plutus-core-test";

nix/shell.nix

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
{ inputs, pkgs, lib, project, agda-tools, metatheory, r-with-packages }:
1+
{ inputs, pkgs, lib, project, agda-tools, metatheory, r-with-packages, mkFourmolu }:
22

33
let
44

55
# Toolchain versions used in dev shells. Consumed by `project.shellFor`.
6-
tools = project.tools {
7-
# "latest" cabal would be 3.14.1.0 which breaks haddock generation.
8-
# TODO update cabal version once haddock generation is fixed upstream.
9-
cabal = "3.12.1.0";
10-
cabal-fmt = "latest";
11-
haskell-language-server = "latest";
12-
# fourmolu 0.18.0.0 and hlint 3.10 require GHC >=9.8
13-
fourmolu = "0.17.0.0";
14-
hlint = "3.8";
15-
stylish-haskell = "latest";
6+
tools = project.tools
7+
{
8+
# "latest" cabal would be 3.14.1.0 which breaks haddock generation.
9+
# TODO update cabal version once haddock generation is fixed upstream.
10+
cabal = "3.12.1.0";
11+
cabal-fmt = "latest";
12+
haskell-language-server = "latest";
13+
hlint = "3.8";
14+
stylish-haskell = "latest";
15+
} // {
16+
fourmolu = mkFourmolu project.args.compiler-nix-name;
1617
};
1718

1819
# Pre-commit hooks for the repo. Injects into shell via shellHook.
@@ -28,15 +29,16 @@ let
2829
package = tools.cabal-fmt;
2930
};
3031
stylish-haskell = {
31-
enable = true;
32+
enable = false;
3233
package = tools.stylish-haskell;
3334
args = [ "--config" ".stylish-haskell.yaml" ];
3435
excludes = [ "^plutus-metatheory/src/MAlonzo" ];
3536
};
3637
fourmolu = {
37-
enable = false;
38+
enable = true;
3839
package = tools.fourmolu;
39-
args = [ "--mode" "inplace" ];
40+
args = [ "--unsafe" ];
41+
excludes = [ "^plutus-metatheory/src/MAlonzo" ];
4042
};
4143
hlint = {
4244
enable = false;

0 commit comments

Comments
 (0)