Split out the `clang-format` hook.
We current set the clang-format
description to:
pre_commit_hook(
name = "clang-format",
src = ":cli",
args = [
"-i",
],
description = "Performs formatting using `clang-format` on various file types.",
stages = ["@pre-commit//pre-commit/stage:pre-commit"],
summary = "Format various file types with `clang-format`",
types_or = [
"@pre-commit//pre-commit/tag:c",
"@pre-commit//pre-commit/tag:c++",
],
)
However, we should split out the clang-format
hook into separate hooks so that it is clear what is being formatted.
We should split this hook into c
/cxx
hooks and include them in a pre_commit_hooks(name = "clang-format")
. We should set the
Later, we can add the JSON, etc formatters:
CSharp: .cs
Java: .java
JavaScript: .mjs .js .ts
Json: .json
Objective-C: .m .mm
Proto: .proto .protodevel
TableGen: .td
TextProto: .txtpb .textpb .pb.txt .textproto .asciipb
Verilog: .sv .svh .v .vh