Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
simplify cabal-fmt.nix and update docs (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana authored and koslambrou committed Jun 22, 2022
1 parent f98b695 commit 1fc6778
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ NOTE: You may want to consider using https://github.com/target/lorri[lorri] as a
The shell comes with some tools for fixing various simple problems that the CI will complain about. Specifically:

- `fix-stylish-haskell` will re-format all the Haskell sources correctly.
- `fix-cabal-fmt` will re-format all the Cabal sources correctly.
- `fix-purs-tidy` will re-format all the Purescript sources correctly.
- `fix-png-optimization` will optimize all PNGs in the repository.

Expand Down
13 changes: 2 additions & 11 deletions nix/tests/cabal-fmt.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
{ runCommand, fixCabalFmt, src, lib, diffutils, glibcLocales }:
let
src' = lib.cleanSourceWith {
inherit src;
filter = with lib;
name: type:
let baseName = baseNameOf (toString name); in
(
(type == "regular" && hasSuffix ".cabal" baseName) ||
(type == "directory" && (baseName != "dist-newstyle" && baseName != "dist" && baseName != ".stack-work"))
);
};
src' = lib.sourceFilesBySuffices src [ ".cabal" ];
in
runCommand "cabal-fmt"
{
Expand All @@ -30,7 +21,7 @@ runCommand "cabal-fmt"
diff -ur orig cabal > $out/cabal.diff
echo "file none $out/cabal.diff" > $out/nix-support/hydra-build-products
echo "*** cabal-fmt found changes that need addressed first"
echo "*** Please run \`fix-stylish-haskell\` and commit changes"
echo "*** Please run \`fix-cabal-fmt\` and commit changes"
echo "*** or apply the diff generated by hydra if you don't have nix."
exit $EXIT_CODE
else
Expand Down

0 comments on commit 1fc6778

Please sign in to comment.