-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpre-commit-hooks.nix
45 lines (41 loc) · 1.37 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
{ pkgs, treefmtEval, ... }:
{
src = ./.;
hooks = {
check-added-large-files.enable = true;
check-case-conflicts.enable = true;
check-executables-have-shebangs.enable = true;
# todo Not integrated with Nix?
check-format = {
enable = true;
entry = "${treefmtEval.config.build.wrapper}/bin/treefmt-nix --fail-on-change";
};
check-json.enable = true;
check-shebang-scripts-are-executable.enable = true;
check-symlinks.enable = true;
check-toml.enable = true;
check-yaml.enable = true;
detect-private-keys.enable = true;
editorconfig-checker.enable = true;
end-of-file-fixer.enable = true;
fix-byte-order-marker.enable = true;
forbid-new-submodules.enable = true;
# todo Enable lychee when asciidoc is supported.
# See https://github.com/lycheeverse/lychee/issues/291
# lychee.enable = true;
# todo Broken for 24.05 branch
# flake-checker.enable = true;
mixed-line-endings.enable = true;
nil.enable = true;
strip-location-metadata = {
name = "Strip location metadata";
description = "Strip geolocation metadata from image files";
enable = true;
entry = "${pkgs.exiftool}/bin/exiftool -duplicates -overwrite_original '-gps*='";
package = pkgs.exiftool;
types = [ "image" ];
};
trim-trailing-whitespace.enable = true;
yamllint.enable = true;
};
}