Skip to content

Commit

Permalink
fix: reduce extra warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tolstenko committed Mar 8, 2023
1 parent 26e3915 commit 64a0e82
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
42 changes: 22 additions & 20 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,41 @@ AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AlwaysBreakTemplateDeclarations: No
BreakBeforeBraces: Attach
ColumnLimit: 100
ColumnLimit: 150
ConstructorInitializerAllOnOneLineOrOnePerLine: true
IncludeBlocks: Merge
#IncludeBlocks: Preserve
IndentPPDirectives: AfterHash
IndentWidth: 2
NamespaceIndentation: All
BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true

SortIncludes: Never

# Some folks prefer to write "int& foo" while others prefer "int &foo". The
# Google Style Guide only asks for consistency within a project, we chose
# "int& foo" for this project:
DerivePointerAlignment: false
PointerAlignment: Left

IncludeCategories:
# Matches common headers first, but sorts them after project includes
- Regex: '^\"google/cloud/internal/disable_deprecation_warnings.inc\"$'
Priority: -1
- Regex: '^\"google/cloud/(internal/|grpc_utils/|testing_util/|[^/]+\.h)'
Priority: 1000
- Regex: '^\"google/cloud/' # project includes should sort first
Priority: 500
- Regex: '^\"'
Priority: 1500
- Regex: '^<grpc/'
Priority: 2000
- Regex: '^<google/*'
Priority: 3000
- Regex: '^<.*/.*'
Priority: 4000
- Regex: '^<[^/]*>'
Priority: 5000
#IncludeCategories:
# # Matches common headers first, but sorts them after project includes
# - Regex: '^\"google/cloud/internal/disable_deprecation_warnings.inc\"$'
# Priority: -1
# - Regex: '^\"google/cloud/(internal/|grpc_utils/|testing_util/|[^/]+\.h)'
# Priority: 1000
# - Regex: '^\"google/cloud/' # project includes should sort first
# Priority: 500
# - Regex: '^\"'
# Priority: 1500
# - Regex: '^<grpc/'
# Priority: 2000
# - Regex: '^<google/*'
# Priority: 3000
# - Regex: '^<.*/.*'
# Priority: 4000
# - Regex: '^<[^/]*>'
# Priority: 5000

# Format raw string literals with a `pb` or `proto` tag as proto.
RawStringFormats:
Expand Down
18 changes: 9 additions & 9 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../core/)
set_target_properties(CoreTests PROPERTIES CXX_STANDARD 20)

# enable compiler warnings
if(NOT TEST_INSTALLED_VERSION)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(core PUBLIC -Wall -Wpedantic -Wextra)
# target_compile_options(core PUBLIC -Wall -Wpedantic -Wextra -Werror)
elseif(MSVC)
target_compile_options(core PUBLIC /W4 /WX)
target_compile_definitions(CoreTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
endif()
endif()
#if(NOT TEST_INSTALLED_VERSION)
# if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
# target_compile_options(core PUBLIC -Wall -Wpedantic -Wextra)
## target_compile_options(core PUBLIC -Wall -Wpedantic -Wextra -Werror)
# elseif(MSVC)
# target_compile_options(core PUBLIC /W4 /WX)
# target_compile_definitions(CoreTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
# endif()
#endif()

# ---- Add CoreTests ----

Expand Down

0 comments on commit 64a0e82

Please sign in to comment.