Skip to content

Commit

Permalink
Clean up clang-format and add a .clangd configuration. (#5075)
Browse files Browse the repository at this point in the history
Signed-off-by: fruffy <[email protected]>
  • Loading branch information
fruffy authored Dec 19, 2024
1 parent 3ec3732 commit f971ca6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
39 changes: 16 additions & 23 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
#
# clang-format configuration file. Intended for clang-format >= 4.
#
# For more information, see:
#
# Documentation/process/clang-format.rst
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
Language: Cpp
BasedOnStyle: Google
IndentWidth: 4
FixNamespaceComments: true
Expand All @@ -22,16 +13,18 @@ DerivePointerAlignment: false
PointerAlignment: Right
Standard: c++17
IncludeCategories:
# Matches common headers first and sorts them before project includes
- Regex: '^<.+/.*\.h>'
Priority: 2000
- Regex: '^<.+/.*>'
Priority: 4000
- Regex: '^<.*\.h>'
Priority: 1000
- Regex: '^<.*>'
Priority: 3000
- Regex: 'testgen/.*'
Priority: 6000
- Regex: '.*'
Priority: 5000
# Matches common headers first and sorts them before project includes
- Regex: '^<.+/.*\.h>'
Priority: 2000
- Regex: "^<.+/.*>"
Priority: 4000
- Regex: '^<.*\.h>'
Priority: 1000
- Regex: "^<.*>"
Priority: 3000
- Regex: "testgen/.*"
Priority: 6000
- Regex: ".*"
Priority: 5000
IncludeIsMainRegex: '(_test)?$'
...
2 changes: 2 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: build/
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ set (GTEST_UNITTEST_SOURCES
gtest/hvec_map.cpp
gtest/hvec_set.cpp
gtest/indexed_vector.cpp
gtest/ir-traversal-test.cpp
gtest/ir-traversal.cpp
gtest/json_test.cpp
gtest/map.cpp
gtest/midend_def_use.cpp
Expand Down
File renamed without changes.

0 comments on commit f971ca6

Please sign in to comment.