diff --git a/.github/workflows/clang_test.yaml b/.github/workflows/clang_test.yaml index b2ec61aa..3bcd2ccc 100644 --- a/.github/workflows/clang_test.yaml +++ b/.github/workflows/clang_test.yaml @@ -40,6 +40,7 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: lfs: true + fetch-depth: 0 # fetch all history for git diff in clang-tidy - name: Build Paimon shell: bash env: diff --git a/cmake_modules/DefineOptions.cmake b/cmake_modules/DefineOptions.cmake index 1652c851..304389ec 100644 --- a/cmake_modules/DefineOptions.cmake +++ b/cmake_modules/DefineOptions.cmake @@ -117,7 +117,7 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") "If on, only git-diff files will be passed to linting tools" ON) define_option_string(PAIMON_LINT_GIT_TARGET_COMMIT - "target commit/branch for comparison in git diff" "HEAD") + "target commit/branch for comparison in git diff" "origin/main") define_option(PAIMON_GENERATE_COVERAGE "Build with C++ code coverage enabled" OFF) diff --git a/src/paimon/common/global_index/global_index_result.cpp b/src/paimon/common/global_index/global_index_result.cpp index b9141f7e..60c615d3 100644 --- a/src/paimon/common/global_index/global_index_result.cpp +++ b/src/paimon/common/global_index/global_index_result.cpp @@ -148,13 +148,13 @@ Result> GlobalIndexResult::ToRanges() const { // Extend the current range range_end = current; } else { - ranges.push_back(Range(range_start, range_end)); + ranges.emplace_back(range_start, range_end); range_start = current; range_end = current; } } // Add the last range - ranges.push_back(Range(range_start, range_end)); + ranges.emplace_back(range_start, range_end); return ranges; } diff --git a/src/paimon/common/utils/range.cpp b/src/paimon/common/utils/range.cpp index 793dfa9b..42d360aa 100644 --- a/src/paimon/common/utils/range.cpp +++ b/src/paimon/common/utils/range.cpp @@ -122,7 +122,7 @@ std::vector Range::Exclude(const std::vector& ranges) const { } // Add the part before the intersection (if any) if (current < intersect.value().from) { - result.push_back(Range(current, intersect.value().from - 1)); + result.emplace_back(current, intersect.value().from - 1); } // Move current position past the intersection current = intersect.value().to + 1; @@ -132,7 +132,7 @@ std::vector Range::Exclude(const std::vector& ranges) const { } // Add the remaining part after all exclusions (if any) if (current <= to) { - result.push_back(Range(current, to)); + result.emplace_back(current, to); } return result;