clang-tidy can already read the compilation database from cmake to run on any file. This sets up some cmake targets to make it easier to run the check on all files applicable to the current platform. It also disables a few analyses to reduce the number of warnings to a manageable level. Actually making any fixes is left for later.
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
---
|
|
# Configuration file for clang-tidy
|
|
# This configuration is tailored for the libuv C library project
|
|
|
|
# Use default checks with minimal necessary disables
|
|
Checks:
|
|
# don't suggest reordering struct definitions
|
|
- -clang-analyzer-optin.performance.Padding
|
|
# allow memcpy (instead of memcpy_s)
|
|
- -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
|
|
# allow strcpy
|
|
- -clang-analyzer-security.insecureAPI.strcpy
|
|
# allow TBAA
|
|
- -clang-analyzer-unix.MallocSizeof
|
|
# always allow `if () statement;` instead of `if () { statement; }`
|
|
- -readability-braces-around-statements
|
|
# allow any use of case and _ conventions in names
|
|
- -readability-identifier-naming
|
|
# allow defining a function prototype without naming all arguments
|
|
- -readability-named-parameter
|
|
# allow 1u instead of 1U constants
|
|
- -readability-uppercase-literal-suffix
|
|
|
|
# Configure specific check options
|
|
CheckOptions:
|
|
- key: performance-unnecessary-value-param.AllowedTypes
|
|
value: 'uv_.*_t'
|
|
- key: readability-braces-around-statements.ShortStatementLines
|
|
value: '2'
|
|
- key: readability-function-size.LineThreshold
|
|
value: '150'
|
|
- key: readability-function-size.StatementThreshold
|
|
value: '80'
|
|
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
|
|
value: 'true'
|
|
|
|
# Header filter - only analyze project files, not system headers
|
|
HeaderFilterRegex: '^.*/(src|include|test)/.*\.(h|c)$'
|
|
|
|
# Format style for fix suggestions
|
|
FormatStyle: file
|
|
|
|
# Treat warnings as errors
|
|
WarningsAsErrors: false
|
|
|
|
# Use color, even when run through a program like ninja
|
|
UseColor: true
|