# 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.
# bugprone-crtp-constructor-accessibility
#   We don't use many classes with Curiously Recurring Template Patterns
#   and it's unlikely that they'd be used incorrectly. This check does not
#   improve the readability of the code.
# performance-noexcept-*
#   Exceptions may be disabled later, adding noexcept is just noise

HeaderFilterRegex: '.*'
ExcludeHeaderFilterRegex: '(external/|generated/|include/|steam/steam_api_flat\.h)'

Checks: >
  -*,
  bugprone-*,
  -bugprone-assignment-in-if-condition,
  -bugprone-branch-clone,
  -bugprone-casting-through-void,
  -bugprone-crtp-constructor-accessibility,
  -bugprone-easily-swappable-parameters,
  -bugprone-implicit-widening-of-multiplication-result,
  -bugprone-incorrect-roundings,
  -bugprone-integer-division,
  -bugprone-macro-parentheses,
  -bugprone-multi-level-implicit-pointer-conversion,
  -bugprone-narrowing-conversions,
  -bugprone-parent-virtual-call,
  -bugprone-reserved-identifier,
  -bugprone-suspicious-include,
  -bugprone-suspicious-realloc-usage,
  -bugprone-switch-missing-default-case,
  -bugprone-unchecked-optional-access,
  -bugprone-unhandled-self-assignment,
  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-include-cleaner,
  -misc-no-recursion,
  -misc-non-private-member-variables-in-classes,
  -misc-predictable-rand,
  -misc-static-assert,
  -misc-unused-parameters,
  -misc-use-anonymous-namespace,
  modernize-avoid-bind,
  modernize-concat-nested-namespaces,
  modernize-deprecated-headers,
  modernize-deprecated-ios-base-aliases,
  modernize-loop-convert,
  modernize-make-shared,
  modernize-make-unique,
  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-nullptr,
  modernize-use-override,
  modernize-use-transparent-functors,
  modernize-use-uncaught-exceptions,
  readability-*,
  -readability-avoid-nested-conditional-operator,
  -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-math-missing-parentheses,
  -readability-named-parameter,
  -readability-non-const-parameter,
  -readability-simplify-boolean-expr,
  -readability-suspicious-call-argument,
  -readability-uppercase-literal-suffix,
  -readability-use-concise-preprocessor-directives,
  -readability-use-std-min-max,
  performance-*,
  -performance-enum-size,
  -performance-no-int-to-ptr,
  -performance-noexcept-*,
  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:           UPPER_CASE
  - key:             readability-identifier-naming.MemberCase
    value:           CamelCase
  - key:             readability-identifier-naming.MemberPrefix
    value:           m_
  - key:             readability-identifier-naming.MemberIgnoredRegexp
    value:           '^(ms?_(a|v|p|pfn)*[A-Z][a-zA-Z0-9]*|[abfghlrsuvwxyz])$'
  - 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:           '^((GL_S|[CI])[A-Z](_?[a-zA-Z0-9])*|_json_value|NETADDR)$'
  - key:             readability-identifier-naming.ClassIgnoredRegexp
    value:           '^([CI][A-Z](_?[a-zA-Z0-9])*)$'
  - key:             readability-identifier-naming.ParameterCase
    value:           CamelCase
  - key:             readability-identifier-naming.ParameterIgnoredRegexp
    value:           '^((a|v|p|pfn)+[A-Z][a-zA-Z0-9]*|[a-z]|[pxy][0-3]|p[xy])$'
  - key:             readability-identifier-naming.ClassMethodIgnoredRegexp
    value:           '^(Con_).*'
  - key:             readability-identifier-naming.ClassMemberIgnoredRegexp
    value:           '^(ms?_(a|v|p|pfn)*[A-Z][a-zA-Z0-9]*|[abfghlrsuvwxyz])$'
  - key:             readability-identifier-naming.LocalConstantIgnoredRegexp
    value:           '^((a|v|p|pfn)+[A-Z][a-zA-Z0-9]*|[abcdfhpqstvw]|[aptvx][0-3]|d[xy])$'
  - key:             readability-identifier-naming.LocalVariableIgnoredRegexp
    value:           '^((a|v|p|pfn)+[A-Z][a-zA-Z0-9]*|[abcdefghijklmnpqrstuvwxyz]|[aptvxy][0-3]|[cdfimpstw][xy])$'

