# Advisory only for now: see .github/workflows/clang-tidy.yml, which runs
# this report-only (it does not fail the job on findings). The performance-*
# family targets exactly the class of bug found in the Eigen unnecessary-copy
# audit (by-value Eigen/STL params, const-ref-to-value copies, ...);
# readability-const-return-type catches `const T foo()` return types that
# block move semantics on the caller side. misc-const-correctness covers the
# same ground as the manual const-correctness sweep (see the element_container
# / LSGrid commit it landed alongside): local variables that are never
# reassigned but aren't declared const. Runs in ~5 minutes over src/core as of
# this writing (own measurement, GCC 13 / clang-tidy 18) -- noticeably slower
# than the other checks here, but still well within the report-only job's
# budget.
#
# modernize-use-override: this codebase used to keep the `virtual` keyword on
# overrides alongside `override`/`final`, which this check flags as
# redundant on every single one of them -- ~80% pure noise against that
# style in an initial run. Rather than suppress the check, the redundant
# `virtual` was dropped codebase-wide (virtual is implied by `override`, and
# by `final` on an actual override) as part of the same final/override sweep,
# and every destructor overriding a base's virtual destructor was annotated
# `override` too, bringing this down to 2 residual warnings, both the same
# explainable case: `override final` used together for defensive
# compile-time checking (marks BOTH "this really overrides something" and
# "no further overrides") on a method in a class that ISN'T itself `final`
# (OneSideContainer::disconnect_if_not_in_main_component,
# TwoSidesContainer::nb_line_end) -- the check prefers `final` alone since it
# implies `override`, but the pair is intentional there and left as-is.
# (Classes that are themselves `final` don't repeat `final` on their
# methods -- redundant, since the class already can't be subclassed at all.)
#
# Known false-positive class: performance-unnecessary-value-param flags every
# `Eigen::Ref<...>` parameter passed by value (the idiom used throughout this
# codebase -- Ref is a thin pointer+size+stride wrapper, cheap to copy) as if
# it were an expensive-to-copy type. Confirmed while validating this config;
# left un-suppressed for now so the report-only phase shows the real noise
# level before anyone spends time tuning NOLINT / config exclusions for it.
Checks: >
  -*,
  performance-*,
  readability-const-return-type,
  misc-const-correctness,
  modernize-use-override
WarningsAsErrors: ''
# Only report on our own headers (src/core, src/bindings) -- clang-tidy's
# default (empty) header filter would otherwise only ever look at the
# primary .cpp file and silently skip every inline-in-header function, which
# is most of this codebase's element_container / powerflow_algorithm classes.
# Vendored trees (eigen/, Catch2/, SuiteSparse/) live outside src/, so this
# regex excludes them without needing a separate exclude list.
HeaderFilterRegex: '.*/src/(core|bindings)/.*'
FormatStyle: none
