-
Notifications
You must be signed in to change notification settings - Fork 1
/
pre-commit-hooks.nix
70 lines (66 loc) · 1.77 KB
/
pre-commit-hooks.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ pkgs, ... }:
{
# Default hooks
trailing-whitespace-fixer = {
enable = true;
name = "trailing-whitespace";
description = "Remove trailing whitespace";
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/trailing-whitespace-fixer";
excludes = [ "^patches/" ];
types = [ "text" ];
};
end-of-file-fixer = {
enable = true;
name = "end-of-file-fixer";
description = "Remove trailing whitespace";
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/end-of-file-fixer";
excludes = [ "^patches/" "png" "svg" ];
types = [ "text" ];
};
fix-byte-order-marker = {
enable = true;
name = "fix-byte-order-marker";
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/fix-byte-order-marker";
types = [ "text" ];
};
mixed-line-ending = {
enable = true;
name = "mixed-line-ending";
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/mixed-line-ending";
excludes = [ "png" ];
types = [ "text" ];
};
check-case-conflict = {
enable = true;
name = "check-case-conflict";
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/check-case-conflict";
types = [ "text" ];
};
detect-private-key = {
enable = true;
name = "detect-private-key";
entry = "${pkgs.python311Packages.pre-commit-hooks}/bin/detect-private-key";
types = [ "text" ];
};
# YAML
yamllint = {
enable = true;
excludes = [ "^styles/" ];
};
# Nix
nixpkgs-fmt.enable = true;
# Markdown
markdownlint = {
enable = true;
excludes = [ "^(docs/reference/|docs/rules/|styles/)" ];
types = [ "markdown" ];
};
# Vale
# vale = {
# enable = true;
# name = "vale";
# entry = "${pkgs.vale}/bin/vale";
# excludes = [ "^styles/" ];
# types = [ "markdown" ];
# };
}