Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit a899abc

Browse files
authored
fix: made .clang-format generic for any repo (#1454)
As we prepare to move to a monorepo, we want all of our existing repos to be formatted with the same .clang-format config. This config removes any per-library specific names (i.e., I removed "spanner"). Instead, this names the headers and directories of the *common* headers and ensures that those sort after the other quoted "google/cloud/.+" includes, which should be the project ones.
1 parent b926894 commit a899abc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.clang-format

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ PointerAlignment: Left
99

1010
IncludeBlocks: Merge
1111
IncludeCategories:
12-
- Regex: '^\"google/cloud/spanner'
13-
Priority: 500
14-
- Regex: '^\"google/cloud/'
12+
# Matches common headers first, but sorts them after project includes
13+
- Regex: '^\"google/cloud/(internal/|grpc_utils/|testing_util/|[^/]+\.h)'
1514
Priority: 1500
15+
- Regex: '^\"google/cloud/' # project includes should sort first
16+
Priority: 500
1617
- Regex: '^\"'
1718
Priority: 1000
1819
- Regex: '^<grpc/'

0 commit comments

Comments
 (0)