Skip to content

Commit

Permalink
Don't format files in the pre-push check
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Rautiola <joonas.rautiola@unikie.com>
  • Loading branch information
joinemm committed Dec 19, 2023
1 parent dd4dbb6 commit 43fe4c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions nix/devshell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
perSystem = {pkgs, ...}: {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
alejandra
azure-cli
git
nix
Expand Down
3 changes: 2 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "nix fmt -- --fail-on-change"
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)
Expand Down

0 comments on commit 43fe4c0

Please sign in to comment.