From 854c6e996f615787477110dbb261cfda0cb041b1 Mon Sep 17 00:00:00 2001 From: Pedro Pedreira Date: Fri, 8 Mar 2024 17:17:57 -0800 Subject: [PATCH] Format check to fix CMake style (#22) Summary: Pull Request resolved: https://github.com/facebookexternal/alpha/pull/22 Reviewed By: sdruzkin Differential Revision: D54643643 Pulled By: pedroerp fbshipit-source-id: 1b3c4b8e5a9bcb1c4fd8c31a51dde4e9b46c0b8f --- .github/workflows/sanity_check.yml | 5 --- dwio/alpha/common/tests/CMakeLists.txt | 9 ++---- dwio/alpha/tablet/CMakeLists.txt | 11 +++---- dwio/alpha/tools/AlphaDump.cpp | 24 +++++++++------ dwio/alpha/velox/CMakeLists.txt | 42 +++++++++++++------------- dwio/alpha/velox/tests/CMakeLists.txt | 8 ++--- 6 files changed, 43 insertions(+), 56 deletions(-) diff --git a/.github/workflows/sanity_check.yml b/.github/workflows/sanity_check.yml index ec4f426..b215853 100644 --- a/.github/workflows/sanity_check.yml +++ b/.github/workflows/sanity_check.yml @@ -31,11 +31,6 @@ jobs: fail-fast: false matrix: config: - - { name: "License Header", - command: "header-fix", - message: "Found missing License Header(s)", - reqs: "regex" - } - { name: "Code Format", command: "format-fix", message: "Found format issues", diff --git a/dwio/alpha/common/tests/CMakeLists.txt b/dwio/alpha/common/tests/CMakeLists.txt index 1309f59..02cdb4e 100644 --- a/dwio/alpha/common/tests/CMakeLists.txt +++ b/dwio/alpha/common/tests/CMakeLists.txt @@ -16,10 +16,5 @@ add_executable( add_test(alpha_common_tests alpha_common_tests) -target_link_libraries( - alpha_common_tests - alpha_common - gtest - gtest_main - glog::glog - Folly::folly) +target_link_libraries(alpha_common_tests alpha_common gtest gtest_main + glog::glog Folly::folly) diff --git a/dwio/alpha/tablet/CMakeLists.txt b/dwio/alpha/tablet/CMakeLists.txt index e9a67f1..135c5e5 100644 --- a/dwio/alpha/tablet/CMakeLists.txt +++ b/dwio/alpha/tablet/CMakeLists.txt @@ -1,7 +1,8 @@ add_subdirectory(tests) -# Alpha code expects an upper case suffix to the generated file. -list(PREPEND FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS "--filename-suffix" "Generated") +# Alpha code expects an upper case suffix to the generated file. +list(PREPEND FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS "--filename-suffix" + "Generated") build_flatbuffers( "${CMAKE_CURRENT_SOURCE_DIR}/Footer.fbs" @@ -15,10 +16,6 @@ add_library(alpha_footer_fb INTERFACE) target_include_directories(alpha_footer_fb INTERFACE ${FLATBUFFERS_INCLUDE_DIR}) add_dependencies(alpha_footer_fb alpha_footer_schema_fb) -add_library( - alpha_tablet - Compression.cpp - StreamInput.cpp - Tablet.cpp) +add_library(alpha_tablet Compression.cpp StreamInput.cpp Tablet.cpp) target_link_libraries(alpha_tablet alpha_footer_fb Folly::folly) diff --git a/dwio/alpha/tools/AlphaDump.cpp b/dwio/alpha/tools/AlphaDump.cpp index 3a500b8..487cec8 100644 --- a/dwio/alpha/tools/AlphaDump.cpp +++ b/dwio/alpha/tools/AlphaDump.cpp @@ -120,9 +120,9 @@ int main(int argc, char* argv[]) { alpha::tools::AlphaDumpLib{ std::cout, options["file"].as()} .emitStreams( - options["no_header"].as(), - options["flatmap_keys"].as(), - getOptional(options["stripe"])); + options["no_header"].as(), + options["flatmap_keys"].as(), + getOptional(options["stripe"])); }, positionalArgs) // clang-format off @@ -159,9 +159,9 @@ int main(int argc, char* argv[]) { alpha::tools::AlphaDumpLib{ std::cout, options["file"].as()} .emitHistogram( - options["root_only"].as(), - options["no_header"].as(), - getOptional(options["stripe"])); + options["root_only"].as(), + options["no_header"].as(), + getOptional(options["stripe"])); }, positionalArgs) // clang-format off @@ -229,9 +229,11 @@ int main(int argc, char* argv[]) { alpha::tools::AlphaDumpLib{ std::cout, options["file"].as()} .emitBinary( - [path = options["output"].as()]() { - return std::make_unique< std::ofstream>(path, std::ios::out | std::ios::binary | std::ios::trunc); - }, + [path = options["output"].as()]() { + return std::make_unique( + path, + std::ios::out | std::ios::binary | std::ios::trunc); + }, options["stream"].as(), options["stripe"].as()); }, @@ -266,7 +268,9 @@ int main(int argc, char* argv[]) { const std::vector& /*args*/) { alpha::tools::AlphaDumpLib{ std::cout, options["file"].as()} - .emitLayout(options["no_header"].as(), !options["uncompressed"].as()); + .emitLayout( + options["no_header"].as(), + !options["uncompressed"].as()); }, positionalArgs) // clang-format off diff --git a/dwio/alpha/velox/CMakeLists.txt b/dwio/alpha/velox/CMakeLists.txt index f5e655e..25f8e4b 100644 --- a/dwio/alpha/velox/CMakeLists.txt +++ b/dwio/alpha/velox/CMakeLists.txt @@ -7,18 +7,16 @@ add_library(alpha_velox_schema SchemaTypes.cpp) target_link_libraries(alpha_velox_schema alpha_common Folly::folly) add_library(alpha_velox_schema_reader SchemaReader.cpp) -target_link_libraries(alpha_velox_schema_reader alpha_velox_schema alpha_common Folly::folly) +target_link_libraries(alpha_velox_schema_reader alpha_velox_schema alpha_common + Folly::folly) add_library(alpha_velox_schema_builder SchemaBuilder.cpp) -target_link_libraries( - alpha_velox_schema_builder - alpha_velox_schema_reader - alpha_velox_schema - alpha_common - Folly::folly) +target_link_libraries(alpha_velox_schema_builder alpha_velox_schema_reader + alpha_velox_schema alpha_common Folly::folly) add_library(alpha_velox_config Config.cpp) -target_link_libraries(alpha_velox_config alpha_encodings alpha_common Folly::folly) +target_link_libraries(alpha_velox_config alpha_encodings alpha_common + Folly::folly) add_library(alpha_velox_field_reader FieldReader.cpp) target_link_libraries(alpha_velox_field_reader alpha_velox_schema_reader @@ -29,11 +27,12 @@ target_link_libraries(alpha_velox_flatmap_layout_planner alpha_velox_schema_reader alpha_tablet velox_file) add_library(alpha_velox_field_writer BufferGrowthPolicy.cpp FieldWriter.cpp) -target_link_libraries(alpha_velox_field_writer - alpha_velox_schema alpha_velox_schema_builder Folly::folly) +target_link_libraries(alpha_velox_field_writer alpha_velox_schema + alpha_velox_schema_builder Folly::folly) # Alpha code expects an upper case suffix to the generated file. -list(PREPEND FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS "--filename-suffix" "Generated") +list(PREPEND FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS "--filename-suffix" + "Generated") build_flatbuffers( "${CMAKE_CURRENT_SOURCE_DIR}/Schema.fbs" @@ -44,7 +43,8 @@ build_flatbuffers( "" "") add_library(alpha_velox_schema_fb INTERFACE) -target_include_directories(alpha_velox_schema_fb INTERFACE ${FLATBUFFERS_INCLUDE_DIR}) +target_include_directories(alpha_velox_schema_fb + INTERFACE ${FLATBUFFERS_INCLUDE_DIR}) add_dependencies(alpha_velox_schema_fb alpha_velox_schema_schema_fb) build_flatbuffers( @@ -56,15 +56,14 @@ build_flatbuffers( "" "") add_library(alpha_velox_metadata_fb INTERFACE) -target_include_directories(alpha_velox_metadata_fb INTERFACE ${FLATBUFFERS_INCLUDE_DIR}) +target_include_directories(alpha_velox_metadata_fb + INTERFACE ${FLATBUFFERS_INCLUDE_DIR}) add_dependencies(alpha_velox_metadata_fb alpha_velox_metadata_schema_fb) add_library(alpha_velox_schema_serialization SchemaSerialization.cpp) target_link_libraries( - alpha_velox_schema_serialization - alpha_velox_schema_reader - alpha_velox_schema_builder - alpha_velox_schema_fb) + alpha_velox_schema_serialization alpha_velox_schema_reader + alpha_velox_schema_builder alpha_velox_schema_fb) add_library(alpha_velox_deserializer Deserializer.cpp) target_link_libraries( @@ -80,8 +79,8 @@ add_library(alpha_velox_serializer Serializer.cpp) target_link_libraries(alpha_velox_serializer alpha_common alpha_velox_schema_builder velox_vector) -add_library(alpha_velox_reader - StreamInputDecoder.cpp StreamLabels.cpp VeloxReader.cpp) +add_library(alpha_velox_reader StreamInputDecoder.cpp StreamLabels.cpp + VeloxReader.cpp) target_link_libraries( alpha_velox_reader alpha_velox_schema @@ -91,7 +90,8 @@ target_link_libraries( alpha_common Folly::folly) -add_library(alpha_velox_writer EncodingLayoutTree.cpp FlushPolicy.cpp - VeloxWriter.cpp VeloxWriterDefaultMetadataOSS.cpp) +add_library( + alpha_velox_writer EncodingLayoutTree.cpp FlushPolicy.cpp VeloxWriter.cpp + VeloxWriterDefaultMetadataOSS.cpp) target_link_libraries(alpha_velox_writer alpha_encodings alpha_common alpha_velox_metadata_fb Folly::folly) diff --git a/dwio/alpha/velox/tests/CMakeLists.txt b/dwio/alpha/velox/tests/CMakeLists.txt index 4a97edc..4221813 100644 --- a/dwio/alpha/velox/tests/CMakeLists.txt +++ b/dwio/alpha/velox/tests/CMakeLists.txt @@ -1,11 +1,7 @@ add_library(alpha_velox_schema_utils SchemaUtils.cpp) target_link_libraries( - alpha_velox_schema_utils - alpha_velox_schema_fb - alpha_velox_schema_builder - alpha_velox_schema_reader - gtest - gtest_main) + alpha_velox_schema_utils alpha_velox_schema_fb alpha_velox_schema_builder + alpha_velox_schema_reader gtest gtest_main) add_executable( alpha_velox_tests