Merge pull request #10794 from obsidiansystems/per-hook-excludes

dev shell: excludes are per hook
This commit is contained in:
John Ericson 2024-05-28 09:56:04 -04:00 committed by GitHub
commit aa5f013d64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,11 +10,8 @@
# https://flake.parts/options/pre-commit-hooks-nix.html#options
pre-commit.settings = {
hooks = {
clang-format.enable = true;
shellcheck.enable = true;
# TODO: nixfmt, https://github.com/NixOS/nixfmt/issues/153
};
clang-format = {
enable = true;
excludes = [
# We don't want to format test data
# ''tests/(?!nixos/).*\.nix''
@ -25,7 +22,7 @@
''^doc/manual/redirects\.js$''
''^doc/manual/theme/highlight\.js$''
# We haven't applied formatting to these files yet (C++)
# We haven't applied formatting to these files yet
''^doc/manual/redirects\.js$''
''^doc/manual/theme/highlight\.js$''
''^precompiled-headers\.h$''
@ -492,8 +489,12 @@
''^tests/unit/libutil/tests\.cc''
''^tests/unit/libutil/url\.cc''
''^tests/unit/libutil/xml-writer\.cc''
# We haven't lintted these files yet (shell)
];
};
shellcheck = {
enable = true;
excludes = [
# We haven't linted these files yet
''^config/install-sh$''
''^misc/systemv/nix-daemon$''
''^misc/bash/completion\.sh$''
@ -723,7 +724,9 @@
''^tests/unit/libutil/data/git/check-data\.sh$''
];
};
# TODO: nixfmt, https://github.com/NixOS/nixfmt/issues/153
};
};
};
# We'll be pulling from this in the main flake