From 4eb429571c0727e6cdddeaaff6d0ac612eec5bcc Mon Sep 17 00:00:00 2001 From: Joonas Rautiola Date: Tue, 19 Dec 2023 12:43:54 +0200 Subject: [PATCH] Don't format files in the pre-push check Signed-off-by: Joonas Rautiola --- nix/devshell.nix | 1 + tasks.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/devshell.nix b/nix/devshell.nix index 5935bc71..a42a5138 100644 --- a/nix/devshell.nix +++ b/nix/devshell.nix @@ -5,6 +5,7 @@ perSystem = {pkgs, ...}: { devShells.default = pkgs.mkShell { packages = with pkgs; [ + alejandra azure-cli git nix diff --git a/tasks.py b/tasks.py index 364a420a..9f30b90e 100644 --- a/tasks.py +++ b/tasks.py @@ -495,9 +495,10 @@ def pre_push(c: Any) -> None: if not ret: LOG.warning("Run `terraform fmt -recursive` locally to fix formatting") sys.exit(1) - cmd = "nix fmt" + cmd = "alejandra --check ." ret = exec_cmd(cmd, raise_on_error=False) if not ret: + LOG.warning("Run `nix fmt` locally to fix formatting") sys.exit(1) cmd = "nix flake check -v" ret = exec_cmd(cmd, raise_on_error=False)