Add .clang-tidy file and CI (#3890)

The CI comments are optional
This commit is contained in:
pajlada 2022-07-31 16:16:22 +02:00 committed by GitHub
parent 3f1b16a855
commit 81773c7d30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 0 deletions

47
.clang-tidy Normal file
View file

@ -0,0 +1,47 @@
Checks: '-*,
clang-diagnostic-*,
llvm-*,
misc-*,
-misc-unused-parameters,
readability-identifier-naming,
-llvm-header-guard,
modernize-*,
readability-*,
performance-*,
misc-*,
bugprone-*,
cert-*,
cppcoreguidelines-*,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-avoid-magic-numbers,
-readability-magic-numbers,
-performance-noexcept-move-constructor,
-misc-non-private-member-variables-in-classes,
-cppcoreguidelines-non-private-member-variables-in-classes,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-bugprone-easily-swappable-parameters,
'
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.MemberCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.GlobalVariableCase
value: UPPER_CASE
- key: readability-identifier-naming.VariableCase
value: camelBack

View file

@ -142,10 +142,19 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \ -DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \ -DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
.. ..
make -j$(nproc) make -j$(nproc)
shell: bash shell: bash
- name: clang-tidy review
if: (startsWith(matrix.os, 'ubuntu') && matrix.pch == false && matrix.qt-version == '5.15.2')
uses: ZedThree/clang-tidy-review@v0.8.4
id: review
with:
build_dir: build
config_file: '.clang-tidy'
- name: Package - AppImage (Ubuntu) - name: Package - AppImage (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
run: | run: |