Configure git-hooks-nix
This commit is contained in:
parent
6d65e70fe3
commit
6c3ab477e0
6 changed files with 112 additions and 1 deletions
16
nix/modules/git-hooks.nix
Normal file
16
nix/modules/git-hooks.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.git-hooks-nix.flakeModule
|
||||
|
||||
./phpcs.nix
|
||||
./phpstan.nix
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{ config, ... }:
|
||||
{
|
||||
devshells.default.devshell.startup.git-hooks.text = config.pre-commit.installationScript;
|
||||
};
|
||||
}
|
7
nix/modules/phpcs.nix
Normal file
7
nix/modules/phpcs.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
perSystem.pre-commit.settings.hooks.phpcs = {
|
||||
enable = true;
|
||||
|
||||
settings.binPath = "vendor/bin/phpcs";
|
||||
};
|
||||
}
|
7
nix/modules/phpstan.nix
Normal file
7
nix/modules/phpstan.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
perSystem.pre-commit.settings.hooks.phpstan = {
|
||||
enable = true;
|
||||
|
||||
settings.binPath = "vendor/bin/phpstan";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue