Skip to content

Commit 51befd6

Browse files
committed
add: conform to support commit-disciline
1 parent a7c6434 commit 51befd6

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

commit-msg.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
conform enforce --commit-msg-file \$1

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,22 @@
4848
# --------------------------------------
4949
# Hooks: use the default company-wide git hooks
5050
# --------------------------------------
51-
hooks = {extraModulesPath, ...}: {
51+
hooks = {
52+
extraModulesPath,
53+
pkgs,
54+
...
55+
}: let
56+
nixpkgs' = nixpkgs.${pkgs.system};
57+
in {
5258
inherit _file;
5359
imports = ["${extraModulesPath}/git/hooks.nix"];
5460
git.hooks.enable = true;
5561
git.hooks.pre-commit.text = builtins.readFile ./pre-commit.sh;
62+
git.hooks.commit-msg.text = builtins.readFile ./commit-msg.sh;
63+
packages = with nixpkgs'; [
64+
conform
65+
editorconfig-checker
66+
];
5667
};
5768

5869
# --------------------------------------

0 commit comments

Comments
 (0)