---

# Tuned for high signal-to-noise on a 937KLOC mature codebase (CoolProp-2uw).
#
# Whitelist mode: enable the bug-finding + modernization + perf categories
# only, then preserve the project's accumulated suppress list within those.
#
# An empirical noise survey on representative src/ files (Solvers.cpp,
# CPstrings.cpp, HelmholtzEOSMixtureBackend.cpp) showed the previous
# "Checks: *, -<dropped>" pattern produced ~60% style/include-hygiene
# noise (misc-include-cleaner, misc-const-correctness,
# readability-isolate-declaration, etc.) before any bug-finding signal
# could be acted on. Switched to a positive whitelist of high-signal
# categories. The clang-tidy CI workflow (dev_clangtidy.yml) is
# informational-only, so this config defines what gets surfaced as
# "interesting" in the artifact.
#
# Per-category notes (from prior incarnation of this file):
#   -cppcoreguidelines-pro-bounds-array-to-pointer-decay : breaks OS_ASSERT
#   -cppcoreguidelines-owning-memory : we use raw pointers under Qt parent
#   -cppcoreguidelines-avoid-non-const-global-variables : Google Tests
#   -modernize-concat-nested-namespaces : doesn't clarify intent
#   -modernize-use-override : enabled after CoolProp-7ue (no override macros);
#       fix-it swept once across src/ + include/ with AllowOverrideAndFinal=true
#       and IgnoreDestructors=true, keep enabled going forward.
#   -cppcoreguidelines-narrowing-conversions / -bugprone-narrowing-conversions :
#       WarnOnEquivalentBitWidth was added in clang-tidy 13; without it
#       the check is too noisy on uint→int conversions, so disabled
#   Aliases (one suppression covers both):
#     cppcoreguidelines-avoid-c-arrays = modernize-avoid-c-arrays
#     cppcoreguidelines-non-private-member-variables-in-classes
#       = misc-non-private-member-variables-in-classes
#     cppcoreguidelines-explicit-virtual-functions, hicpp-use-override
#       = modernize-use-override
#     bugprone-narrowing-conversions = cppcoreguidelines-narrowing-conversions

Checks: |
  -*,
  bugprone-*,
  cert-*,
  clang-analyzer-*,
  cppcoreguidelines-*,
  modernize-*,
  performance-*,
  readability-implicit-bool-conversion,
  hicpp-exception-baseclass,
  hicpp-multiway-paths-covered,
  hicpp-no-assembler,
  hicpp-signed-bitwise,
  -bugprone-easily-swappable-parameters,
  -bugprone-narrowing-conversions,
  -cppcoreguidelines-avoid-c-arrays,
  -cppcoreguidelines-avoid-magic-numbers,
  -cppcoreguidelines-avoid-non-const-global-variables,
  -cppcoreguidelines-explicit-virtual-functions,
  -cppcoreguidelines-narrowing-conversions,
  -cppcoreguidelines-non-private-member-variables-in-classes,
  -cppcoreguidelines-owning-memory,
  -cppcoreguidelines-pro-bounds-array-to-pointer-decay,
  -cppcoreguidelines-pro-bounds-constant-array-index,
  -modernize-concat-nested-namespaces,
  -modernize-use-trailing-return-type,

WarningsAsErrors: '*'
HeaderFilterRegex: '*'
FormatStyle:     file
CheckOptions:
  - key:             performance-for-range-copy.WarnOnAllAutoCopies
    value:           'true'
  # modernize-use-override tuning (CoolProp-7ue): allow `override final`
  # together rather than collapsing to `final` only, and don't add `override`
  # to destructors (the project's convention; matches the historical 2uw.13
  # configuration).
  - key:             modernize-use-override.AllowOverrideAndFinal
    value:           'true'
  - key:             modernize-use-override.IgnoreDestructors
    value:           'true'
  - key:             readability-implicit-bool-conversion.AllowPointerConditions
    value:           'true'
  # Use <cmath> rather than <math.h> when init-variables --fix injects NAN.
  # Without this option clang-tidy adds <math.h>, which then conflicts with
  # the modernize-deprecated-headers cleanup already merged in PR #2805.
  - key:             cppcoreguidelines-init-variables.MathHeader
    value:           '<cmath>'
