From 64a0e820a391744e7d716c00d937cb8f0ffb28b9 Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Tue, 7 Mar 2023 22:59:16 -0500 Subject: [PATCH] fix: reduce extra warnings --- .clang-format | 42 ++++++++++++++++++++++-------------------- test/CMakeLists.txt | 18 +++++++++--------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/.clang-format b/.clang-format index d9a26653..3e83c043 100644 --- a/.clang-format +++ b/.clang-format @@ -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: '^' - 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: '^' +# Priority: 5000 # Format raw string literals with a `pb` or `proto` tag as proto. RawStringFormats: diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c60c2740..736fa64e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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 ----