mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-17 17:24:21 +02:00
flake: move formatting and git hooks into dedicated modules
Some checks failed
Publish every Git push to main to FlakeHub / flakehub-publish (push) Has been cancelled
Publish every git push to Flakestry / publish-flake (push) Has been cancelled
Documentation / Version info (push) Has been cancelled
Documentation / Build (push) Has been cancelled
Documentation / Combine builds (push) Has been cancelled
Documentation / Deploy (push) Has been cancelled
Some checks failed
Publish every Git push to main to FlakeHub / flakehub-publish (push) Has been cancelled
Publish every git push to Flakestry / publish-flake (push) Has been cancelled
Documentation / Version info (push) Has been cancelled
Documentation / Build (push) Has been cancelled
Documentation / Combine builds (push) Has been cancelled
Documentation / Deploy (push) Has been cancelled
This commit is contained in:
parent
97819ce539
commit
1fb1bf8a73
3 changed files with 133 additions and 117 deletions
62
flake/dev/git-hooks.nix
Normal file
62
flake/dev/git-hooks.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.git-hooks.flakeModule
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
{
|
||||
pre-commit = {
|
||||
# We have a treefmt check already, so this is redundant.
|
||||
# We also can't run the test if it includes running `nix build`,
|
||||
# since the nix CLI can't build within a derivation builder.
|
||||
check.enable = false;
|
||||
|
||||
settings.hooks = {
|
||||
deadnix = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
noLambdaArg = true;
|
||||
noLambdaPatternNames = true;
|
||||
edit = true;
|
||||
};
|
||||
};
|
||||
treefmt = {
|
||||
enable = true;
|
||||
package = config.formatter;
|
||||
};
|
||||
typos = {
|
||||
enable = true;
|
||||
excludes = [ "generated/*" ];
|
||||
};
|
||||
maintainers = {
|
||||
enable = true;
|
||||
name = "maintainers";
|
||||
description = "Check maintainers when it is modified.";
|
||||
files = "^lib/maintainers[.]nix$";
|
||||
package = pkgs.nix;
|
||||
entry = "nix build --no-link --print-build-logs";
|
||||
args = [ ".#checks.${system}.maintainers" ];
|
||||
pass_filenames = false;
|
||||
};
|
||||
plugins-by-name = {
|
||||
enable = true;
|
||||
name = "plugins-by-name";
|
||||
description = "Check `plugins/by-name` when it's modified.";
|
||||
files = "^(?:tests/test-sources/)?plugins/by-name/";
|
||||
package = pkgs.nix;
|
||||
entry = "nix build --no-link --print-build-logs";
|
||||
args = [ ".#checks.${system}.plugins-by-name" ];
|
||||
pass_filenames = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue