mirror of
https://github.com/tweag/ormolu.git
synced 2024-08-16 16:30:29 +03:00
Format .cabal
files with cabal-gild
This commit is contained in:
parent
7a334ac3a0
commit
504cce242f
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
||||
with:
|
||||
extra_nix_config: |
|
||||
accept-flake-config = true
|
||||
- name: Format via Cabal and Ormolu
|
||||
- name: Format via Ormolu
|
||||
run: |
|
||||
nix run .#format
|
||||
git diff --exit-code --color=always
|
||||
|
89
flake.lock
89
flake.lock
@ -87,7 +87,7 @@
|
||||
"inputs": {
|
||||
"fenix": "fenix",
|
||||
"naersk": "naersk",
|
||||
"nixpkgs": "nixpkgs_5",
|
||||
"nixpkgs": "nixpkgs_6",
|
||||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
@ -122,7 +122,7 @@
|
||||
},
|
||||
"fenix": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"rust-analyzer-src": "rust-analyzer-src"
|
||||
},
|
||||
"locked": {
|
||||
@ -159,11 +159,11 @@
|
||||
"flake-compat_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -336,11 +336,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1660459072,
|
||||
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
||||
"lastModified": 1709087332,
|
||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -677,7 +677,7 @@
|
||||
},
|
||||
"naersk": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
"nixpkgs": "nixpkgs_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1655042882,
|
||||
@ -860,16 +860,16 @@
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1685801374,
|
||||
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
|
||||
"lastModified": 1720386169,
|
||||
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
|
||||
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-23.05",
|
||||
"ref": "nixos-24.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
@ -907,6 +907,22 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1719082008,
|
||||
"narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9693852a2070b398ee123a329e68f0dab5526681",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1655400192,
|
||||
"narHash": "sha256-49OBVVRgb9H/PSmNT9W61+NRdDbuSJVuDDflwXlaUKU=",
|
||||
@ -922,20 +938,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1655481042,
|
||||
"narHash": "sha256-XHbcywq2vIQ5CeH1OK3TN793jkiNAAZsSctS1PFgseo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "103a4c0ae46afa9cf008c30744175315ca38e9f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1655481042,
|
||||
@ -951,6 +953,20 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_6": {
|
||||
"locked": {
|
||||
"lastModified": 1655481042,
|
||||
"narHash": "sha256-XHbcywq2vIQ5CeH1OK3TN793jkiNAAZsSctS1PFgseo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "103a4c0ae46afa9cf008c30744175315ca38e9f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_7": {
|
||||
"locked": {
|
||||
"lastModified": 1656549732,
|
||||
"narHash": "sha256-eILutFZGjfk2bEzfim8S/qyYc//0S1KsCeO+OWbtoR0=",
|
||||
@ -1017,26 +1033,21 @@
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1696846637,
|
||||
"narHash": "sha256-0hv4kbXxci2+pxhuXlVgftj/Jq79VSmtAyvfabCCtYk=",
|
||||
"lastModified": 1720524665,
|
||||
"narHash": "sha256-ni/87oHPZm6Gv0ECYxr1f6uxB0UKBWJ6HvS7lwLU6oY=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "42e1b6095ef80a51f79595d9951eb38e91c4e6ca",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "8d6a17d0cdf411c55f12602624df6368ad86fac1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
@ -1044,7 +1055,7 @@
|
||||
"inputs": {
|
||||
"deadnix": "deadnix",
|
||||
"make-shell": "make-shell_2",
|
||||
"nixpkgs": "nixpkgs_6",
|
||||
"nixpkgs": "nixpkgs_7",
|
||||
"utils": "utils_2"
|
||||
},
|
||||
"locked": {
|
||||
|
@ -7,11 +7,7 @@
|
||||
};
|
||||
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
|
||||
|
||||
# for Ormolu Live
|
||||
ghc-wasm-meta.url = "gitlab:ghc/ghc-wasm-meta?host=gitlab.haskell.org";
|
||||
@ -119,6 +115,7 @@
|
||||
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
cabal-gild.enable = true;
|
||||
nixpkgs-fmt.enable = true;
|
||||
deadnix.enable = true;
|
||||
purs-tidy.enable = true;
|
||||
@ -150,7 +147,6 @@
|
||||
name = "ormolu-format";
|
||||
text = builtins.readFile ./nix/format.sh;
|
||||
runtimeInputs = [
|
||||
(defaultGHC.dev.hsPkgs.tool "cabal" "latest")
|
||||
defaultGHC.ormolu
|
||||
];
|
||||
};
|
||||
@ -165,6 +161,7 @@
|
||||
configureArgs = "--disable-benchmarks --disable-tests";
|
||||
};
|
||||
};
|
||||
nativeBuildInputs = pre-commit-check.enabledPackages;
|
||||
withHoogle = false;
|
||||
exactDeps = false;
|
||||
inherit (pre-commit-check) shellHook;
|
||||
|
@ -2,10 +2,6 @@
|
||||
|
||||
export LANG="C.UTF-8"
|
||||
|
||||
cabal format
|
||||
(cd extract-hackage-info && cabal format)
|
||||
(cd ormolu-live && cabal format)
|
||||
|
||||
export dirs="src app tests extract-hackage-info/src ormolu-live/app"
|
||||
# shellcheck disable=SC2046,SC2086
|
||||
ormolu -m inplace $(find $dirs -type f -name "*.hs" -o -name "*.hs-boot")
|
||||
|
Loading…
Reference in New Issue
Block a user