From 9b26507e14c2d3b0a167e037f424425ba3676211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 11 Jun 2022 11:56:10 +0200 Subject: [PATCH] add treefmt check --- nix/checks/treefmt.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 nix/checks/treefmt.nix diff --git a/nix/checks/treefmt.nix b/nix/checks/treefmt.nix new file mode 100644 index 0000000..5e165a4 --- /dev/null +++ b/nix/checks/treefmt.nix @@ -0,0 +1,22 @@ +{ + runCommandNoCC, + gofumpt, + alejandra, + python3, + treefmt, +}: +runCommandNoCC "treefmt" { + nativeBuildInputs = [ + gofumpt + treefmt + alejandra + python3.pkgs.flake8 + python3.pkgs.black + ]; +} '' + # keep timestamps so that treefmt is able to detect mtime changes + cp --no-preserve=mode --preserve=timestamps -r ${../..} source + cd source + HOME=$TMPDIR treefmt --no-cache --fail-on-change + touch $out +''