Skip to content

Commit

Permalink
Format C++
Browse files Browse the repository at this point in the history
  • Loading branch information
artnc committed Jun 10, 2024
1 parent 294f91b commit 5692139
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This repo currently contains a single [pre-commit](https://pre-commit.com/) hook
- [shfmt](https://github.com/mvdan/sh) v3.7.0 for Shell
- [xsltproc](http://www.xmlsoft.org/xslt/xsltproc.html) from libxslt v10138 for XML
- [terraform fmt](https://github.com/hashicorp/terraform) v1.6.3 for Terraform
- [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) v17.0.4 for Protobuf
- [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) v17.0.4 for C++, Protobuf
- [SVGO](https://github.com/svg/svgo) v3.0.3 for SVG
- [Taplo](https://taplo.tamasfe.dev/) v0.8.1 for TOML
- Custom regex transformations (basically [sed](https://en.wikipedia.org/wiki/Sed)), for example:
Expand Down
2 changes: 1 addition & 1 deletion entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const HOOKS: Record<HookName, LockableHook> = {
"--style=Google",
...sources,
),
include: /\.proto$/,
include: /\.(cpp|proto$)/,
runAfter: [HookName.Sed],
}),
[HookName.Gofmt]: createLockableHook({
Expand Down
6 changes: 6 additions & 0 deletions test/after/hello.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <iostream>

int main() {
std::cout << "Hello world";
return 0;
}
3 changes: 3 additions & 0 deletions test/before/hello.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <iostream>

int main ( ){std::cout<<"Hello world";return 0 ;}

0 comments on commit 5692139

Please sign in to comment.