Skip to content

Make clang-tidy happy #117

@zz-jason

Description

@zz-jason

Background

Clang-Tidy is a clang-based C++ “linter” tool designed to help developers identify and fix common programming errors, such as style violations, interface misuse, and bugs that can be detected through static analysis12. It provides an extensible framework for diagnosing and correcting these issues, making it a valuable tool for maintaining code quality.

Currently, all the clang-tidy checks are confined in .clang-tidy file, there are still many check failures.

Make clang-tidy happy

Let's fix all these clang-tidy check violations and enable clang-tidy checks in CI. You can find these errors with the following steps:

# 0. install clang-tidy
sudo apt install -y clang-tidy

# 1. generate compile database (compile_commands.json)
cmake --preset=debug

# 2. run clang-tidy on certain files in the source/include directory, for example:
export FILES_TO_CHECK="include/leanstore/btree/*.hpp"
clang-tidy -p=build/debug --config-file=.clang-tidy -extra-arg='--std=c++2b' ${FILES_TO_CHECK}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions