mirror of
https://github.com/google/ormolu.git
synced 2024-09-11 08:05:24 +03:00
Assert that Ormolu is formatted with current version of Ormolu
This commit is contained in:
parent
368b2da09b
commit
c386de89bd
@ -29,6 +29,11 @@ jobs:
|
||||
- run:
|
||||
name: Build the package (includes running the tests)
|
||||
command: nix-build --keep-going
|
||||
- run:
|
||||
name: Check formatting
|
||||
command: |
|
||||
./format.sh
|
||||
git diff --exit-code --color=always
|
||||
- run:
|
||||
name: Generate Haddocks
|
||||
command: nix-build --attr ormolu.doc
|
||||
|
@ -55,5 +55,10 @@ User settings -> Account integrations -> Refresh permissions
|
||||
|
||||
in Circle CI app.
|
||||
|
||||
## Formatting
|
||||
|
||||
Use `format.sh` script to format Ormolu with current version of Ormolu. If
|
||||
Ormolu is not formatted like this, the CI will fail.
|
||||
|
||||
[issues]: https://github.com/tweag/ormolu/issues
|
||||
[bugs]: https://github.com/tweag/ormolu/issues?q=is%3Aissue+is%3Aopen+label%3Abug
|
||||
|
@ -41,6 +41,7 @@ let
|
||||
}) haskellPackages;
|
||||
in {
|
||||
ormolu = haskellPackages.ormolu;
|
||||
locales = pkgs.glibcLocales;
|
||||
ormoluShell = haskellPackages.shellFor {
|
||||
packages = ps: [ ps.ormolu ];
|
||||
buildInputs = [ haskellPackages.cabal-install haskellPackages.ghcid ];
|
||||
|
10
format.sh
Executable file
10
format.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Format Ormolu using current version of Ormolu.
|
||||
|
||||
set -e
|
||||
|
||||
export LANG="en_US.UTF-8"
|
||||
|
||||
nix run -f default.nix ormolu locales -c ormolu --mode inplace $(find src -type f \( -name "*.hs" -o -name "*.hs-boot" \))
|
||||
nix run -f default.nix ormolu locales -c ormolu --mode inplace $(find tests -type f -name "*.hs")
|
Loading…
Reference in New Issue
Block a user