feat(rust): rustfmt check example

This commit is contained in:
Florian Warzecha 2024-05-16 18:19:41 +02:00
parent 90b7063195
commit 17a8f609e5
Signed by: liketechnik
GPG key ID: 4BE8C7D97F910C60

View file

@ -93,6 +93,29 @@
{ {
formatter = forSystems ({ pkgs, ... }: pkgs.alejandra); formatter = forSystems ({ pkgs, ... }: pkgs.alejandra);
checks = forSystems (
{ pkgs, fenixChannel, ... }:
{
rustfmt =
pkgs.runCommand "check-rustfmt"
{
nativeBuildInputs =
let
fenixRustToolchain = fenixChannel.withComponents [
"cargo"
"rustfmt-preview"
];
in
[ fenixRustToolchain ];
}
''
cd ${./.}
cargo fmt -- --check
touch $out
'';
}
);
packages = forSystems ( packages = forSystems (
{ {
pkgs, pkgs,