diff options
author | Alyssa Ross <alyssa.ross@unikie.com> | 2022-11-15 11:27:28 +0000 |
---|---|---|
committer | Alyssa Ross <alyssa.ross@unikie.com> | 2022-11-18 16:44:08 +0000 |
commit | 6c0c95661b43075d8e66171d5ff4cd682aded8ca (patch) | |
tree | f198b898e2b737bd964d2d1f3c98a1a96898dc8c | |
parent | e2cdde0af4cebd13ceacf4ce7ce70e689bbe9dbc (diff) | |
download | spectrum-6c0c95661b43075d8e66171d5ff4cd682aded8ca.tar spectrum-6c0c95661b43075d8e66171d5ff4cd682aded8ca.tar.gz spectrum-6c0c95661b43075d8e66171d5ff4cd682aded8ca.tar.bz2 spectrum-6c0c95661b43075d8e66171d5ff4cd682aded8ca.tar.lz spectrum-6c0c95661b43075d8e66171d5ff4cd682aded8ca.tar.xz spectrum-6c0c95661b43075d8e66171d5ff4cd682aded8ca.tar.zst spectrum-6c0c95661b43075d8e66171d5ff4cd682aded8ca.zip |
nix/checks.nix: add rustfmt check
Signed-off-by: Alyssa Ross <alyssa.ross@unikie.com>
-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" { |