dev shell: excludes are per hook

As suggested by Robert in
https://github.com/NixOS/nix/pull/10787#discussion_r1617145374
This commit is contained in:
John Ericson 2024-05-28 09:28:06 -04:00
parent cc98fce039
commit ebc29017fc

View file

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