diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..201734d --- /dev/null +++ b/.clang-format @@ -0,0 +1,4 @@ +BasedOnStyle: Google + +# Sorting includes is dangerous and can break compilation +SortIncludes: Never diff --git a/.dockerignore b/.dockerignore index 3338c6a..596916b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ * +!.clang-format !.editorconfig !entry.ts !ruff.toml diff --git a/entry.ts b/entry.ts index 163dab1..4982f9a 100644 --- a/entry.ts +++ b/entry.ts @@ -178,7 +178,7 @@ const HOOKS: Record = { run( "/clang-format", "-i", // Edit files in-place - "--style=Google", + "--style=file:/.clang-format", ...sources, ), include: /\.(cpp|proto$)/, diff --git a/test/after/hello.cpp b/test/after/hello.cpp index 6ef0d39..b3bc5dc 100644 --- a/test/after/hello.cpp +++ b/test/after/hello.cpp @@ -1,4 +1,5 @@ #include +#include int main() { std::cout << "Hello world"; diff --git a/test/before/hello.cpp b/test/before/hello.cpp index f460750..5a669e3 100644 --- a/test/before/hello.cpp +++ b/test/before/hello.cpp @@ -1,3 +1,4 @@ #include + #include int main ( ){std::cout<<"Hello world";return 0 ;}