Skip to content

Commit 11b3af2

Browse files
authored
Preserve C++ include order (#43)
1 parent 609a290 commit 11b3af2

File tree

5 files changed

+8
-1
lines changed

5 files changed

+8
-1
lines changed

.clang-format

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BasedOnStyle: Google
2+
3+
# Sorting includes is dangerous and can break compilation
4+
SortIncludes: Never

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*
2+
!.clang-format
23
!.editorconfig
34
!entry.ts
45
!ruff.toml

entry.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const HOOKS: Record<HookName, LockableHook> = {
178178
run(
179179
"/clang-format",
180180
"-i", // Edit files in-place
181-
"--style=Google",
181+
"--style=file:/.clang-format",
182182
...sources,
183183
),
184184
include: /\.(cpp|proto$)/,

test/after/hello.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <iostream>
2+
#include <cmath>
23

34
int main() {
45
std::cout << "Hello world";

test/before/hello.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#include <iostream>
2+
#include <cmath>
23

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

0 commit comments

Comments
 (0)