Static Code Analysis (SCA)ΒΆ
Note
Fixing all code warnings from static code analysis is not required for the GitHub actions workflow to succeed. In general, fixing all warnings is very tedious and can be numerous false alerts. In these cases, we should try to add them to some ignore list.
In our continuous integration, we apply the following tools for static code analysis (SCA):
The status of the static code analysis can be seen in this GitHub badge:
Our current clang-tidy configuration can be found in the .clang-tidy file file in the root folder of the repository:
1Checks:
2 - '*'
3 - '-altera-unroll-loops'
4 - '-boost-use-ranges'
5 - '-clang-diagnostic-note'
6 - '-clang-diagnostic-error'
7 - '-cppcoreguidelines-avoid-do-while'
8 - '.cppcoreguidelines-non-private-member-variables-in-classes'
9 - '-cppcoreguidelines-pro-type-reinterpret-cast'
10 - '-cppcoreguidelines-pro-type-union-access'
11 - '-cppcoreguidelines-pro-type-vararg'
12 - '-fuchsia-default-arguments-calls'
13 - '-fuchsia-default-arguments-declarations'
14 - '-fuchsia-overloaded-operator'
15 - '-google-readability-todo'
16 - '-hicpp-uppercase-literal-suffix'
17 - '-hicpp-vararg'
18 - '-llvmlibc-*'
19 - '-llvm-header-guard'
20 - '-misc-no-recursion'
21 - '-misc-non-private-member-variables-in-classes'
22 - '-modernize-use-trailing-return-type'
23 - '-readability-*'
24
25FormatStyle: 'file'
26HeaderFilterRegex: '^(?!.*vulkan-renderer/build).*'
27ExtraArgs:
28 - -std=c++20
29
30CheckOptions:
31 - key: 'bugprone-argument-comment.CommentBoolLiterals'
32 value: '0'
33 - key: 'bugprone-assert-side-effect.AssertMacros'
34 value: 'assert'
35 - key: 'bugprone-dangling-handle.HandleClasses'
36 value: 'std::basic_string_view;std::experimental::basic_string_view'
37 - key: 'bugprone-dynamic-static-initializers.HeaderFileExtensions'
38 value: ',h,hh,hpp,hxx'
39 - key: 'bugprone-suspicious-string-compare.WarnOnImplicitComparison'
40 value: '1'
41 - key: 'cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors'
42 value: '1'
43 - key: 'cppcoreguidelines-no-malloc.Allocations'
44 value: '::malloc;::calloc'
45 - key: 'google-readability-function-size.StatementThreshold'
46 value: '800'
47 - key: 'readability-identifier-naming.FunctionCase'
48 value: 'lower_case'
49 - key: 'readability-static-accessed-through-instance.NameSpecifierNestingThreshold'
50 value: '3'