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..99c7848 --- /dev/null +++ b/.github/workflows/check-style.yml @@ -0,0 +1,30 @@ +name: Code style check + +on: + push: + branches: ["main"] + # paths: ["**.h", "**.c"] + pull_request: + branches: ["main"] + # paths: ["**.h", "**.c"] + +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 + files-changed-only: false \ No newline at end of file