Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Checks: 'boost-*,bugprone-*,clang-diagnostic*,cppcoreguidelines-*,modernize-*,misc-*,performance-*,readability-*,-bugprone-easily-swappable-parameters,-cppcoreguidelines-avoid-do-while,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-vararg,-modernize-use-trailing-return-type,-misc-include-cleaner,-misc-non-private-member-variables-in-classes'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*\/(olp-cpp-sdk-core|olp-cpp-sdk-authentication|olp-cpp-sdk-dataservice-read|olp-cpp-sdk-dataservice-write)\/.*'
FormatStyle: 'file'
CheckOptions:
- key: readability-function-cognitive-complexity.IgnoreMacros
value: true
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.MethodCase
value: CamelCase
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
- key: readability-identifier-naming.ProtectedMemberSuffix
value: _
- key: readability-identifier-naming.FunctionCase
value: CamelCase
- key: readability-identifier-naming.ConstexprVariableCase
value: CamelCase
- key: readability-identifier-naming.ConstexprVariablePrefix
value: k
- key: readability-identifier-naming.StaticConstantCase
value: CamelCase
- key: readability-identifier-naming.StaticConstantPrefix
value: k
- key: readability-identifier-naming.GlobalConstantCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantPrefix
value: k
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantPrefix
value: k
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.VariableCase
value: lower_case
18 changes: 18 additions & 0 deletions .github/workflows/psv_pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ jobs:
run: ./scripts/misc/cpplint_ci.sh
shell: bash

psv-linux-24-04-clang17-build-clang-tidy:
name: PSV.Linux.24.04.clang17.ClangTidy
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libboost-all-dev \
libcurl4-openssl-dev
shell: bash
- name: Run clang-tidy
run: ./scripts/misc/clang-tidy-17-check.sh
shell: bash

psv-linux-22-04-gcc9-build-test-codecov:
name: PSV.Linux.22.04.gcc9.Tests.CodeCov
runs-on: ubuntu-22.04
Expand Down
24 changes: 24 additions & 0 deletions scripts/misc/clang-tidy-17-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -ex

BUILD_DIR="build-clang-tidy"

rm -rf "${BUILD_DIR}"
mkdir "${BUILD_DIR}"

cmake -S . -B "${BUILD_DIR}" -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER=clang++-17 \
-DCMAKE_C_COMPILER=clang-17 \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
-DOLP_SDK_ENABLE_TESTING=OFF \
-DOLP_SDK_BUILD_EXAMPLES=OFF

cmake --build "${BUILD_DIR}" -- -j"$(nproc)"

run-clang-tidy-17.py -p "${BUILD_DIR}" \
-config-file="${PWD}/.clang-tidy" \
"${PWD}/olp-cpp-sdk-core/.*" \
"${PWD}/olp-cpp-sdk-authentication/.*" \
"${PWD}/olp-cpp-sdk-dataservice-read/.*" \
"${PWD}/olp-cpp-sdk-dataservice-write/.*"
Loading