mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
2fa4c1f603
- Remove `readability-identifier-naming.StaticVariableIgnoredRegexp`. - Mark `static` variables as `const` and use `UPPER_CASE` for names when possible. - Use local variables instead of `static` variables when possible. - Use member variables with correct name instead of `static` variables. - Pass output buffer for `static` function `GetKeyBindModifiersName` by argument instead of returning pointer to `static` buffer.
149 lines
6.8 KiB
YAML
149 lines
6.8 KiB
YAML
# Why we disabled individual checks:
|
|
#
|
|
# clang-analyzer-optin.cplusplus.UninitializedObject
|
|
# TODO: Occurs commonly in graphics_threaded.h
|
|
# clang-analyzer-optin.cplusplus.VirtualCall
|
|
# Occurs very commonly all over
|
|
# clang-analyzer-optin.performance.Padding
|
|
# Too annoying to always align for perfect padding
|
|
# clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
|
# TODO: Requires C11 to fix
|
|
# misc-unused-parameters
|
|
# TODO: Many changes
|
|
# misc-use-anonymous-namespace
|
|
# We don't want to use anonymous namespaces instead of static functions.
|
|
# bugprone-suspicious-realloc-usage
|
|
# We generally don't handle memory allocation failures.
|
|
|
|
Checks: >
|
|
-*,
|
|
bugprone-*,
|
|
-bugprone-assignment-in-if-condition,
|
|
-bugprone-branch-clone,
|
|
-bugprone-easily-swappable-parameters,
|
|
-bugprone-implicit-widening-of-multiplication-result,
|
|
-bugprone-incorrect-roundings,
|
|
-bugprone-integer-division,
|
|
-bugprone-macro-parentheses,
|
|
-bugprone-narrowing-conversions,
|
|
-bugprone-parent-virtual-call,
|
|
-bugprone-reserved-identifier,
|
|
-bugprone-suspicious-include,
|
|
-bugprone-unhandled-self-assignment,
|
|
-bugprone-suspicious-realloc-usage,
|
|
-bugprone-switch-missing-default-case,
|
|
-bugprone-casting-through-void,
|
|
-bugprone-multi-level-implicit-pointer-conversion,
|
|
-bugprone-unchecked-optional-access,
|
|
clang-analyzer-*,
|
|
-clang-analyzer-optin.cplusplus.UninitializedObject,
|
|
-clang-analyzer-optin.cplusplus.VirtualCall,
|
|
-clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker,
|
|
-clang-analyzer-optin.performance.Padding,
|
|
-clang-analyzer-osx.cocoa.RetainCount,
|
|
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
|
-clang-analyzer-security.insecureAPI.rand,
|
|
cppcoreguidelines-avoid-goto,
|
|
cppcoreguidelines-interfaces-global-init,
|
|
cppcoreguidelines-slicing,
|
|
cppcoreguidelines-virtual-class-destructor,
|
|
misc-*,
|
|
-misc-const-correctness,
|
|
-misc-no-recursion,
|
|
-misc-non-private-member-variables-in-classes,
|
|
-misc-static-assert,
|
|
-misc-unused-parameters,
|
|
-misc-use-anonymous-namespace,
|
|
-misc-include-cleaner,
|
|
modernize-avoid-bind,
|
|
modernize-concat-nested-namespaces,
|
|
modernize-deprecated-headers,
|
|
modernize-deprecated-ios-base-aliases,
|
|
modernize-loop-convert,
|
|
modernize-make-unique,
|
|
modernize-make-shared,
|
|
modernize-redundant-void-arg,
|
|
modernize-replace-auto-ptr,
|
|
modernize-replace-disallow-copy-and-assign-macro,
|
|
modernize-replace-random-shuffle,
|
|
modernize-shrink-to-fit,
|
|
modernize-unary-static-assert,
|
|
modernize-use-bool-literals,
|
|
modernize-use-emplace,
|
|
modernize-use-equals-default,
|
|
modernize-use-equals-delete,
|
|
modernize-use-override,
|
|
modernize-use-transparent-functors,
|
|
modernize-use-uncaught-exceptions,
|
|
readability-*,
|
|
-readability-braces-around-statements,
|
|
-readability-convert-member-functions-to-static,
|
|
-readability-else-after-return,
|
|
-readability-function-cognitive-complexity,
|
|
-readability-function-size,
|
|
-readability-identifier-length,
|
|
-readability-implicit-bool-conversion,
|
|
-readability-isolate-declaration,
|
|
-readability-magic-numbers,
|
|
-readability-named-parameter,
|
|
-readability-non-const-parameter,
|
|
-readability-simplify-boolean-expr,
|
|
-readability-suspicious-call-argument,
|
|
-readability-uppercase-literal-suffix,
|
|
-readability-use-std-min-max,
|
|
-readability-avoid-nested-conditional-operator,
|
|
performance-*,
|
|
-performance-no-int-to-ptr,
|
|
-performance-enum-size,
|
|
portability-*,
|
|
|
|
WarningsAsErrors:
|
|
readability-identifier-naming,
|
|
|
|
CheckOptions:
|
|
- key: readability-identifier-naming.LocalVariableCase
|
|
value: CamelCase
|
|
- key: readability-identifier-naming.StaticConstantCase
|
|
value: aNy_CasE
|
|
- key: readability-identifier-naming.StaticVariableCase
|
|
value: aNy_CasE
|
|
- key: readability-identifier-naming.LocalConstantCase
|
|
value: CamelCase
|
|
- key: readability-identifier-naming.ClassMemberCase
|
|
value: CamelCase
|
|
- key: readability-identifier-naming.MemberCase
|
|
value: CamelCase
|
|
- key: readability-identifier-naming.MemberPrefix
|
|
value: m_
|
|
- key: readability-identifier-naming.MemberIgnoredRegexp
|
|
value: '^(m_ap|m_v|m_p|m_a|ms_p|[a-z]$).*'
|
|
- key: readability-identifier-naming.ClassMemberPrefix
|
|
value: ms_
|
|
- key: readability-identifier-naming.StaticVariablePrefix
|
|
value: s_
|
|
- key: readability-identifier-naming.ClassMethodCase
|
|
value: CamelCase
|
|
- key: readability-identifier-naming.ClassCase
|
|
value: CamelCase
|
|
- key: readability-identifier-naming.ClassPrefix
|
|
value: C
|
|
- key: readability-identifier-naming.StructPrefix
|
|
value: S
|
|
- key: readability-identifier-naming.StructIgnoredRegexp
|
|
value: '^([CS]|MapObject$|EnvelopedQuad$).*'
|
|
- key: readability-identifier-naming.ClassIgnoredRegexp
|
|
value: '^(I|CCommandProcessorFragment_Vulkan$).*'
|
|
- key: readability-identifier-naming.ParameterCase
|
|
value: CamelCase
|
|
- key: readability-identifier-naming.ParameterIgnoredRegexp
|
|
value: '^(p|a|v|[a-z]$|s[hw]$|warning_msg$|error_msg$|string$|integer$|boolean$|object$|index$|rhs$|lhs$|[xy]off$|id$|mode$|rgb$|[xy][0123]$|width$|height$|[sdw][xy]$|ownId$|fnMatchCallback$).*'
|
|
- key: readability-identifier-naming.ClassMethodIgnoredRegexp
|
|
value: '^(Con_).*'
|
|
- key: readability-identifier-naming.ClassMemberIgnoredRegexp
|
|
value: '^(m_a|m_v|m_p|ms_p|ms_a|ms_v|s_1024x1024ImgSize$|s_ImageBufferCacheId$|s_VertexBufferCacheId$|s_StagingBufferImageCacheId$|REPLACEMENT_CHARACTER$|(MAX|MIN)_FONT_SIZE$|MAXIMUM_ATLAS_DIMENSION$|INITIAL_ATLAS_DIMENSION$|MAX_SECTION_DIMENSION_MAPPED$|MIN_SECTION_DIMENSION$|s_StagingBufferCacheId$).*'
|
|
- key: readability-identifier-naming.LocalConstantIgnoredRegexp
|
|
value: '^(p|a|v|s_|MAX_ANIM_SPEED$|DATA_OFFSET$|HEADER_LEN$|MIN_ANIM_SPEED$|[hwdcbqstf]$|[xt][0123]$|result$|sub$|it$|len$|d[xy]$).*'
|
|
- key: readability-identifier-naming.LocalVariableIgnoredRegexp
|
|
value: '^(p|a|s_|FT_|TB_|s_|ul_|v|[xy]i$|[zijklxyhmrgbacwestnduvqf]$|[dmpwsitcf][xy]$|(ch|skel)[0-2]?$|it$|tw$|dt$|th$|ls$|func$|res$|shader$|len$|maxLength$|length$|offset$|offpos$|result$|bg$|sp$|url$|index$|ctxt$|key$|null$|logger$|LAST_MODIFIED$|teleNr$|target$|id$|hit$|hsl[0-2]?$|rgb[0-2]?$|dir$|tmp$|sub$|ret$|rendered$|(lower|upper)(16|26|24|32)|size$|isWeaponCollide$|zerochar$|dist$|sound$|match$|best_matches$|matches$|nohook$|btn$|savedLayers$|l[hw]$|evilz$|sec$|min$|to2$|delay$|mode$|maxModes$|numModes$|[xy]Fract$|[xy]Int$|imgg[xy]$|skip$|localPlayer$|fdratio$|[rgbat][0-2]$|[xy][0-3]$|x[rl]$).*'
|
|
|