Compare commits

...

1 Commits

Author SHA1 Message Date
David Robillard 2d0b0defdf Add a clean clang-tidy configuration
This configuration just suppresses the necessary clang-* checks which are
enabled by default.  This way has a bit of file spam, but is nice because
different components (in particular, ones actually internal to ardour) can be
audited/strengthened independently.
2023-09-09 23:42:18 -04:00
27 changed files with 178 additions and 0 deletions

16
.clang-tidy Normal file
View File

@ -0,0 +1,16 @@
Checks: >
# The clang-* checks are enabled by default. To enable extra checks, add
# patterns for them above this comment, for example:
# bugprone-*,
# cert-*,
# cppcoreguidelines-*,
# google-*,
# hicpp-*,
# misc-*,
# modernize-*,
# objc-*,
#
# Or go nuclear with "*"
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
FormatStyle: file

24
gtk2_ardour/.clang-tidy Normal file
View File

@ -0,0 +1,24 @@
Checks: >
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-cplusplus.StringChecker,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-optin.portability.UnixAPI,
-clang-analyzer-security.FloatLoopCounter,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-analyzer-unix.Malloc,
-clang-diagnostic-#warnings,
-clang-diagnostic-constant-conversion,
-clang-diagnostic-fortify-source,
-clang-diagnostic-implicit-const-int-float-conversion,
-clang-diagnostic-non-virtual-dtor,
-clang-diagnostic-null-dereference,
-clang-diagnostic-self-assign-overloaded,
-clang-diagnostic-switch,
-clang-diagnostic-undefined-bool-conversion,
-clang-diagnostic-unused-but-set-variable,
-clang-diagnostic-unused-const-variable,
-clang-diagnostic-unused-label,
InheritParentConfig: true

17
libs/ardour/.clang-tidy Normal file
View File

@ -0,0 +1,17 @@
Checks: >
-clang-analyzer-core.DivideZero,
-clang-analyzer-core.NullDereference,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-cplusplus.StringChecker,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-diagnostic-#warnings,
-clang-diagnostic-bitwise-instead-of-logical,
-clang-diagnostic-sign-compare,
-clang-diagnostic-uninitialized,
-clang-diagnostic-unused-but-set-variable,
-clang-diagnostic-unused-private-field,
-clang-diagnostic-unused-variable,
InheritParentConfig: true

View File

@ -0,0 +1,4 @@
Checks: >
-clang-analyzer-core.DivideZero,
-clang-analyzer-deadcode.DeadStores,
InheritParentConfig: true

View File

@ -0,0 +1,7 @@
Checks: >
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-security.insecureAPI.vfork,
-clang-diagnostic-unused-const-variable,
InheritParentConfig: true

4
libs/canvas/.clang-tidy Normal file
View File

@ -0,0 +1,4 @@
Checks: >
-clang-analyzer-core.uninitialized.Assign,
-clang-diagnostic-braced-scalar-init,
InheritParentConfig: true

View File

@ -0,0 +1,6 @@
Checks: >
-clang-analyzer-deadcode.DeadStores,
-clang-diagnostic-cast-qual,
-clang-diagnostic-enum-conversion,
-clang-diagnostic-literal-conversion,
InheritParentConfig: true

View File

@ -0,0 +1,4 @@
Checks: >
-clang-diagnostic-varargs,
-clang-analyzer-cplusplus.NewDeleteLeaks,
InheritParentConfig: true

4
libs/evoral/.clang-tidy Normal file
View File

@ -0,0 +1,4 @@
Checks: >
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.VirtualCall,
InheritParentConfig: true

View File

@ -0,0 +1,7 @@
Checks: >
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-diagnostic-c11-extensions,
-clang-diagnostic-strict-prototypes,
InheritParentConfig: true

3
libs/fst/.clang-tidy Normal file
View File

@ -0,0 +1,3 @@
Checks: >
-clang-analyzer-optin.cplusplus.VirtualCall,
InheritParentConfig: true

View File

@ -0,0 +1,6 @@
Checks: >
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-diagnostic-null-dereference,
InheritParentConfig: true

4
libs/hidapi/.clang-tidy Normal file
View File

@ -0,0 +1,4 @@
Checks: >
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-unix.Malloc,
InheritParentConfig: true

3
libs/libltc/.clang-tidy Normal file
View File

@ -0,0 +1,3 @@
Checks: >
-clang-analyzer-security.insecureAPI.strcpy,
InheritParentConfig: true

3
libs/midi++2/.clang-tidy Normal file
View File

@ -0,0 +1,3 @@
Checks: >
-clang-analyzer-optin.cplusplus.VirtualCall,
InheritParentConfig: true

4
libs/panners/.clang-tidy Normal file
View File

@ -0,0 +1,4 @@
Checks: >
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-optin.cplusplus.CallAndMessage,
InheritParentConfig: true

7
libs/pbd/.clang-tidy Normal file
View File

@ -0,0 +1,7 @@
Checks: >
-clang-analyzer-core.NonNullParamChecker,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-cplusplus.StringChecker,
-clang-analyzer-security.insecureAPI.vfork,
-clang-analyzer-unix.Vfork,
InheritParentConfig: true

5
libs/plugins/.clang-tidy Normal file
View File

@ -0,0 +1,5 @@
Checks: >
-clang-analyzer-core.NullDereference,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-security.insecureAPI.strcpy,
InheritParentConfig: true

View File

@ -0,0 +1,4 @@
Checks: >
-clang-analyzer-deadcode.DeadStores,
-clang-diagnostic-unused-but-set-variable,
InheritParentConfig: true

8
libs/qm-dsp/.clang-tidy Normal file
View File

@ -0,0 +1,8 @@
Checks: >
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-deadcode.DeadStores,
-clang-diagnostic-cast-align,
-clang-diagnostic-cast-qual,
InheritParentConfig: true

12
libs/surfaces/.clang-tidy Normal file
View File

@ -0,0 +1,12 @@
Checks: >
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-core.uninitialized.UndefReturn,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.CallAndMessage,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-diagnostic-sometimes-uninitialized,
-clang-diagnostic-unused-but-set-variable,
-clang-diagnostic-unused-variable,
-clang-diagnostic-varargs,
InheritParentConfig: true

View File

@ -0,0 +1,7 @@
Checks: >
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-diagnostic-logical-not-parentheses,
-clang-analyzer-core.CallAndMessage,
-clang-diagnostic-unused-but-set-variable,
-clang-analyzer-deadcode.DeadStores,
InheritParentConfig: true

View File

@ -0,0 +1,7 @@
Checks: >
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-core.uninitialized.Assign,
-clang-analyzer-cplusplus.NewDelete,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-deadcode.DeadStores,
InheritParentConfig: true

View File

@ -0,0 +1,4 @@
Checks: >
-clang-analyzer-deadcode.DeadStores,
-clang-diagnostic-unused-but-set-variable,
InheritParentConfig: true

4
libs/widgets/.clang-tidy Normal file
View File

@ -0,0 +1,4 @@
Checks: >
-clang-analyzer-deadcode.DeadStores,
-clang-diagnostic-null-dereference,
InheritParentConfig: true

3
luasession/.clang-tidy Normal file
View File

@ -0,0 +1,3 @@
Checks: >
-clang-analyzer-security.insecureAPI.strcpy,
InheritParentConfig: true

View File

@ -958,6 +958,7 @@ def configure(conf):
set_version ()
conf.load('compiler_c')
conf.load('compiler_cxx')
conf.load('clang_compilation_database')
if Options.options.dist_target == 'mingw':
conf.load('winres')
elif Options.options.clang_compile_db: