fix pre-commit hook
This commit is contained in:
6
.githooks/pre-commit
Executable file
6
.githooks/pre-commit
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
nix fmt .
|
||||
git diff --exit-code || {
|
||||
echo "Formatter changed files — review with 'git diff', then re-stage and commit."
|
||||
exit 1
|
||||
}
|
||||
@@ -10,13 +10,12 @@
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
hooks.pre-commit = pkgs.writeShellScript "pre-commit" ''
|
||||
nix fmt .
|
||||
git diff --exit-code || {
|
||||
echo "Formatter changed files — review with 'git diff', then re-stage and commit."
|
||||
exit 1
|
||||
includes = [
|
||||
{
|
||||
condition = "gitdir:~/.setup/";
|
||||
contents.core.hooksPath = "~/.setup/.githooks";
|
||||
}
|
||||
'';
|
||||
];
|
||||
settings = {
|
||||
user.name = "Kabbone";
|
||||
user.email = "tobias@opel-online.de";
|
||||
|
||||
Reference in New Issue
Block a user