diff options
-rw-r--r-- | nix/checks.nix | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nix/checks.nix b/nix/checks.nix index 9ffdc0a..df21d69 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -6,6 +6,24 @@ { recurseForDerivations = true; + rustfmt = config.pkgs.callPackage ( + { lib, runCommand, rustfmt }: + runCommand "spectrum-rustfmt" { + src = lib.cleanSourceWith { + filter = path: type: + (builtins.baseNameOf path != "build" && type == "directory") + || builtins.match ''.*[^/]\.rs'' path != null; + src = lib.cleanSource ../.; + }; + + nativeBuildInputs = [ rustfmt ]; + } '' + shopt -s globstar + rustfmt --check $src/**/*.rs + touch $out + '' + ) {}; + shellcheck = config.pkgs.callPackage ( { lib, runCommand, shellcheck }: runCommand "spectrum-shellcheck" { |