2023-06-28 17:40:44 +00:00
|
|
|
{ pkgs, toolchain }:
|
2022-12-05 18:27:12 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pkgs) writeShellApplication;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
|
|
|
|
# Format
|
|
|
|
check-rustfmt = (writeShellApplication {
|
|
|
|
name = "check-rustfmt";
|
|
|
|
runtimeInputs = [ toolchain ];
|
|
|
|
text = "cargo fmt --check";
|
|
|
|
});
|
|
|
|
|
|
|
|
# Spelling
|
|
|
|
check-spelling = (writeShellApplication {
|
|
|
|
name = "check-spelling";
|
|
|
|
runtimeInputs = with pkgs; [ git codespell ];
|
|
|
|
text = ''
|
|
|
|
codespell \
|
2023-05-17 14:27:14 +00:00
|
|
|
--ignore-words-list="ba,sur,crate,pullrequest,pullrequests,ser,distroname" \
|
|
|
|
--skip="./target,.git,./src/action/linux/selinux" \
|
2022-12-05 18:27:12 +00:00
|
|
|
.
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
# NixFormatting
|
|
|
|
check-nixpkgs-fmt = (writeShellApplication {
|
|
|
|
name = "check-nixpkgs-fmt";
|
|
|
|
runtimeInputs = with pkgs; [ git nixpkgs-fmt findutils ];
|
|
|
|
text = ''
|
|
|
|
nixpkgs-fmt --check .
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
# EditorConfig
|
|
|
|
check-editorconfig = (writeShellApplication {
|
|
|
|
name = "check-editorconfig";
|
|
|
|
runtimeInputs = with pkgs; [ eclint ];
|
|
|
|
text = ''
|
|
|
|
eclint .
|
|
|
|
'';
|
|
|
|
});
|
2023-03-29 17:24:08 +00:00
|
|
|
|
|
|
|
# Semver
|
|
|
|
check-semver = (writeShellApplication {
|
|
|
|
name = "check-semver";
|
|
|
|
runtimeInputs = with pkgs; [ cargo-semver-checks ];
|
|
|
|
text = ''
|
|
|
|
cargo-semver-checks semver-checks check-release
|
|
|
|
'';
|
|
|
|
});
|
2022-12-05 18:27:12 +00:00
|
|
|
}
|