Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,18 @@ in
};
};
};
gitlint = mkOption {
description = "gitlint hook";
type = types.submodule {
imports = [ hookModule ];
options.flags = mkOption {
type = types.listOf types.str;
description = "Flags passed to gitlint. See all available [here](https://jorisroovers.com/gitlint/latest/configuration/cli/)";
default = [ ];
example = [ "-c" "title-max-length.line-length=120" ];
};
};
};
golines = mkOption {
description = "golines hook";
type = types.submodule {
Expand Down Expand Up @@ -2933,7 +2945,11 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
name = "gitlint";
description = "Linting for your git commit messages";
package = tools.gitlint;
entry = "${hooks.gitlint.package}/bin/gitlint --staged --msg-filename";
entry = lib.escapeShellArgs (
[ "${hooks.gitlint.package}/bin/gitlint" ]
++ hooks.gitlint.flags
++ [ "--staged" "--msg-filename" ]
);
stages = [ "commit-msg" ];
};
gofmt =
Expand Down