Skip to content

Commit

Permalink
Fix clang tidy and clangd diagnostics check workflow (#3254)
Browse files Browse the repository at this point in the history
  • Loading branch information
mewim committed Apr 11, 2024
1 parent 7ed37e0 commit b9112f4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 36 deletions.
36 changes: 7 additions & 29 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,30 +269,6 @@ jobs:
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
make javatest
tidy-and-diagnostics:
name: clang tidy & clangd diagnostics check
needs: [clang-format, sanity-checks]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32

steps:
- uses: actions/checkout@v3

# For `napi.h` header.
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api

- name: Check for clangd diagnostics
run: make clangd-diagnostics

- name: Run clang-tidy
run: make tidy

- name: Run clang-tidy analyzer
run: make tidy-analyzer

sanity-checks:
name: sanity checks
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -382,17 +358,19 @@ jobs:
needs: [gcc-build-test, clang-build-test]
uses: ./.github/workflows/benchmark-workflow.yml

macos-clang-tidy:
name: macos clang tidy & clangd diagnostics check
clang-tidy:
name: clang tidy & clangd diagnostics check
needs: [clang-format, sanity-checks]
runs-on: self-hosted-mac-x64
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
GEN: ninja
NUM_THREADS: 32
CC: clang
CXX: clang++

steps:
- uses: actions/checkout@v3

# For `napi.h` header.
- name: Ensure Node.js dependencies
run: npm install --include=dev
Expand Down
2 changes: 0 additions & 2 deletions src/common/arrow/arrow_row_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ void ArrowRowBatch::templateCopyNonNullValue<LogicalTypeID::NODE>(ArrowVector* v
std::int64_t propertyId = 2;
auto numProperties = NodeVal::getNumProperties(value);
for (auto i = 0u; i < numProperties; i++) {
auto name = NodeVal::getPropertyName(value, i);
auto val = NodeVal::getPropertyVal(value, i);
appendValue(vector->childData[propertyId].get(),
*StructType::getFieldTypes(&type)[propertyId], val);
Expand All @@ -377,7 +376,6 @@ void ArrowRowBatch::templateCopyNonNullValue<LogicalTypeID::REL>(ArrowVector* ve
std::int64_t propertyId = 2;
auto numProperties = NodeVal::getNumProperties(value);
for (auto i = 0u; i < numProperties; i++) {
auto name = NodeVal::getPropertyName(value, i);
auto val = NodeVal::getPropertyVal(value, i);
appendValue(vector->childData[propertyId].get(),
*StructType::getFieldTypes(&type)[propertyId], val);
Expand Down
2 changes: 0 additions & 2 deletions src/include/function/string/functions/contains_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace function {
struct Contains {
static inline void operation(common::ku_string_t& left, common::ku_string_t& right,
uint8_t& result) {
auto lStr = left.getAsString();
auto rStr = right.getAsString();
int64_t pos;
Find::operation(left, right, pos);
result = (pos != 0);
Expand Down
1 change: 0 additions & 1 deletion src/parser/transform/transform_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ std::unique_ptr<ParsedExpression> Transformer::transformNullOperatorExpression(
std::unique_ptr<ParsedExpression> Transformer::transformPropertyOrLabelsExpression(
CypherParser::OC_PropertyOrLabelsExpressionContext& ctx) {
auto atom = transformAtom(*ctx.oC_Atom());
auto raw = ctx.oC_Atom()->getText();
if (!ctx.oC_PropertyLookup().empty()) {
auto lookUpCtx = ctx.oC_PropertyLookup(0);
auto result = createPropertyExpression(*lookUpCtx, std::move(atom));
Expand Down
1 change: 0 additions & 1 deletion src/planner/plan/plan_port_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ std::unique_ptr<LogicalPlan> Planner::planExportDatabase(const BoundStatement& s
std::unique_ptr<LogicalPlan> Planner::planImportDatabase(const BoundStatement& statement) {
auto& boundImportDatabase =
ku_dynamic_cast<const BoundStatement&, const BoundImportDatabase&>(statement);
auto filePath = boundImportDatabase.getFilePath();
auto query = boundImportDatabase.getQuery();
auto plan = std::make_unique<LogicalPlan>();
auto importDatabase = make_shared<LogicalImportDatabase>(query);
Expand Down
3 changes: 2 additions & 1 deletion src/processor/operator/hash_join/join_hash_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ void JoinHashTable::buildHashSlots() {
for (auto i = 0u; i < tupleBlock->numTuples; i++) {
auto lastSlotEntryInHT = insertEntry(tuple);
auto prevPtr = getPrevTuple(tuple);
memcpy(prevPtr, &lastSlotEntryInHT, sizeof(uint8_t*));
memcpy(reinterpret_cast<void*>(prevPtr), reinterpret_cast<void*>(&lastSlotEntryInHT),
sizeof(uint8_t*));
tuple += factorizedTable->getTableSchema()->getNumBytesPerTuple();
}
}
Expand Down

0 comments on commit b9112f4

Please sign in to comment.