Add 'clang-format' pre-commit hook
This commit is contained in:
parent
5be01b43fb
commit
8f752e0f94
10
flake.nix
10
flake.nix
|
@ -47,6 +47,16 @@
|
|||
src = ./.;
|
||||
|
||||
hooks = {
|
||||
clang-format = {
|
||||
enable = true;
|
||||
name = "clang-format";
|
||||
entry = "${pkgs.clang-tools}/bin/clang-format -style=file -i";
|
||||
types = [ "text" "c" ];
|
||||
# I don't care for generated files' formatting
|
||||
excludes = [ "src/parser.c" "src/tree_sitter/parser.h" ];
|
||||
language = "system";
|
||||
};
|
||||
|
||||
nixpkgs-fmt = {
|
||||
enable = true;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue