Skip to content

Commit

Permalink
Format check to fix CMake style (#22)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #22

Reviewed By: sdruzkin

Differential Revision: D54643643

Pulled By: pedroerp

fbshipit-source-id: 1b3c4b8e5a9bcb1c4fd8c31a51dde4e9b46c0b8f
  • Loading branch information
pedroerp authored and facebook-github-bot committed Mar 9, 2024
1 parent 3d130c6 commit 854c6e9
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 56 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/sanity_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 2 additions & 7 deletions dwio/alpha/common/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 4 additions & 7 deletions dwio/alpha/tablet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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)
24 changes: 14 additions & 10 deletions dwio/alpha/tools/AlphaDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ int main(int argc, char* argv[]) {
alpha::tools::AlphaDumpLib{
std::cout, options["file"].as<std::string>()}
.emitStreams(
options["no_header"].as<bool>(),
options["flatmap_keys"].as<bool>(),
getOptional<uint32_t>(options["stripe"]));
options["no_header"].as<bool>(),
options["flatmap_keys"].as<bool>(),
getOptional<uint32_t>(options["stripe"]));
},
positionalArgs)
// clang-format off
Expand Down Expand Up @@ -159,9 +159,9 @@ int main(int argc, char* argv[]) {
alpha::tools::AlphaDumpLib{
std::cout, options["file"].as<std::string>()}
.emitHistogram(
options["root_only"].as<bool>(),
options["no_header"].as<bool>(),
getOptional<uint32_t>(options["stripe"]));
options["root_only"].as<bool>(),
options["no_header"].as<bool>(),
getOptional<uint32_t>(options["stripe"]));
},
positionalArgs)
// clang-format off
Expand Down Expand Up @@ -229,9 +229,11 @@ int main(int argc, char* argv[]) {
alpha::tools::AlphaDumpLib{
std::cout, options["file"].as<std::string>()}
.emitBinary(
[path = options["output"].as<std::string>()]() {
return std::make_unique< std::ofstream>(path, std::ios::out | std::ios::binary | std::ios::trunc);
},
[path = options["output"].as<std::string>()]() {
return std::make_unique<std::ofstream>(
path,
std::ios::out | std::ios::binary | std::ios::trunc);
},
options["stream"].as<uint32_t>(),
options["stripe"].as<uint32_t>());
},
Expand Down Expand Up @@ -266,7 +268,9 @@ int main(int argc, char* argv[]) {
const std::vector<std::string>& /*args*/) {
alpha::tools::AlphaDumpLib{
std::cout, options["file"].as<std::string>()}
.emitLayout(options["no_header"].as<bool>(), !options["uncompressed"].as<bool>());
.emitLayout(
options["no_header"].as<bool>(),
!options["uncompressed"].as<bool>());
},
positionalArgs)
// clang-format off
Expand Down
42 changes: 21 additions & 21 deletions dwio/alpha/velox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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
Expand All @@ -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)
8 changes: 2 additions & 6 deletions dwio/alpha/velox/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 854c6e9

Please sign in to comment.