From 875be67b1b3c94ef7fc708348f7de9c18f863874 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Mon, 21 Oct 2024 19:49:26 +0200 Subject: [PATCH] nix: added formatting.all One can run: ``` nix build .\#hydraJobs.x86_64-linux.native.formatting.all ``` to check all formatters. --- nix/formatting.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/nix/formatting.nix b/nix/formatting.nix index 0723707621..f37c890e27 100644 --- a/nix/formatting.nix +++ b/nix/formatting.nix @@ -24,10 +24,17 @@ let echo $EXIT_CODE > $out fi ''; + formatting = { + stylish = checkFormatting pkgs.stylish-haskell ../scripts/ci/run-stylish.sh; + cabal-gild = checkFormatting pkgs.cabal-gild ../scripts/ci/run-cabal-gild.sh; + nixpkgs-fmt = checkFormatting pkgs.nixpkgs-fmt ../scripts/ci/run-nixpkgs-fmt.sh; + dos2unix = checkFormatting pkgs.dos2unix ../scripts/ci/run-dos2unix.sh; + }; in -{ - stylish = checkFormatting pkgs.stylish-haskell ../scripts/ci/run-stylish.sh; - cabal-gild = checkFormatting pkgs.cabal-gild ../scripts/ci/run-cabal-gild.sh; - nixpkgs-fmt = checkFormatting pkgs.nixpkgs-fmt ../scripts/ci/run-nixpkgs-fmt.sh; - dos2unix = checkFormatting pkgs.dos2unix ../scripts/ci/run-dos2unix.sh; +formatting // { + all = pkgs.releaseTools.aggregate { + name = "consensus-formatting"; + meta.description = "Run all formatters"; + constituents = lib.collect lib.isDerivation formatting; + }; }