Skip to content

Commit 4e78441

Browse files
authored
Merge pull request #560 from f1rstlady/gitlint
feat: add gitlint hook
2 parents 879387f + ba017b2 commit 4e78441

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
@@ -2655,6 +2655,13 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
26552655
package = tools.fprettify;
26562656
entry = "${hooks.fprettify.package}/bin/fprettify";
26572657
};
2658+
gitlint = {
2659+
name = "gitlint";
2660+
description = "Linting for your git commit messages";
2661+
package = tools.gitlint;
2662+
entry = "${hooks.gitlint.package}/bin/gitlint --staged --msg-filename";
2663+
stages = [ "commit-msg" ];
2664+
};
26582665
gofmt =
26592666
{
26602667
name = "gofmt";

nix/tools.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
, flake-checker ? null
3232
, fprettify
3333
, git-annex
34+
, gitlint
3435
, gptcommit ? null
3536
, hadolint
3637
, haskellPackages
@@ -125,6 +126,7 @@ in
125126
elixir
126127
flake-checker
127128
fprettify
129+
gitlint
128130
go
129131
go-tools
130132
golangci-lint

0 commit comments

Comments
 (0)