Skip to content

Commit ba017b2

Browse files
committed
feat: add gitlint hook
1 parent 9364dc0 commit ba017b2

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ clang-format supports.
351351
- [commitizen](https://github.com/commitizen-tools/commitizen)
352352
- [convco](https://github.com/convco/convco)
353353
- [forbid-new-submodules](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/forbid_new_submodules.py)
354+
- [gitlint](https://github.com/jorisroovers/gitlint)
354355
- [gptcommit](https://github.com/zurawiki/gptcommit)
355356
- [no-commit-to-branch](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/no_commit_to_branch.py)
356357

modules/hooks.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,13 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
26412641
package = tools.fprettify;
26422642
entry = "${hooks.fprettify.package}/bin/fprettify";
26432643
};
2644+
gitlint = {
2645+
name = "gitlint";
2646+
description = "Linting for your git commit messages";
2647+
package = tools.gitlint;
2648+
entry = "${hooks.gitlint.package}/bin/gitlint --staged --msg-filename";
2649+
stages = [ "commit-msg" ];
2650+
};
26442651
gofmt =
26452652
{
26462653
name = "gofmt";

nix/tools.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
, flake-checker ? null
3131
, fprettify
3232
, git-annex
33+
, gitlint
3334
, gptcommit ? null
3435
, hadolint
3536
, haskellPackages
@@ -122,6 +123,7 @@ in
122123
elixir
123124
flake-checker
124125
fprettify
126+
gitlint
125127
go
126128
go-tools
127129
golangci-lint

0 commit comments

Comments
 (0)