From 66d06039d76c06d4f736e7a3444effd1a53e90f6 Mon Sep 17 00:00:00 2001 From: Evgenyi Safronov Date: Tue, 14 Jan 2025 09:14:05 +0300 Subject: [PATCH] feat: clang-tidy code style action --- .clang-tidy | 28 ++++++++++++++++++++++++++++ .github/workflows/check-style.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .clang-tidy create mode 100644 .github/workflows/check-style.yml diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..cc08171 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,28 @@ +Checks: "-*,readability-identifier-naming" +CheckOptions: + readability-identifier-naming.ConstantCase: lower_case + readability-identifier-naming.ConstantParameterCase: lower_case + readability-identifier-naming.ConstantPointerParameterCase: lower_case + readability-identifier-naming.EnumCase: lower_case + readability-identifier-naming.EnumConstantCase: lower_case + readability-identifier-naming.FunctionCase: lower_case + readability-identifier-naming.GlobalConstantCase: lower_case + readability-identifier-naming.GlobalConstantPointerCase: lower_case + readability-identifier-naming.GlobalFunctionCase: lower_case + readability-identifier-naming.GlobalPointerCase: lower_case + readability-identifier-naming.GlobalVariableCase: lower_case + readability-identifier-naming.LocalConstantCase: lower_case + readability-identifier-naming.LocalConstantPointerCase: lower_case + readability-identifier-naming.LocalPointerCase: lower_case + readability-identifier-naming.LocalVariableCase: lower_case + readability-identifier-naming.ParameterCase: lower_case + readability-identifier-naming.ParameterPackCase: lower_case + readability-identifier-naming.PointerParameterCase: lower_case + readability-identifier-naming.StaticConstantCase: lower_case + readability-identifier-naming.StaticVariableCase: lower_case + readability-identifier-naming.StructCase: lower_case + readability-identifier-naming.TypedefCase: lower_case + readability-identifier-naming.UnionCase: lower_case + readability-identifier-naming.VariableCase: lower_case + # + readability-braces-around-statements: true diff --git a/.github/workflows/check-style.yml b/.github/workflows/check-style.yml new file mode 100644 index 0000000..a69e439 --- /dev/null +++ b/.github/workflows/check-style.yml @@ -0,0 +1,27 @@ +name: Code style check + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + cpp-linter: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: cpp-linter/cpp-linter-action@main + id: linter + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: file + # Use .clang-tidy config file. + tidy-checks: '' + version: 19 + thread-comments: false + step-summary: true + tidy-review: false + format-review: false