# clang-tidy 14, matching the clang-format version pinned in CI.
#
# performance-* and portability-* are enabled wholesale: the tree is clean
# against both, so they cost nothing and guard against regressions.
# bugprone-* and misc-* are enabled wholesale too, minus four checks that are
# not actionable here: narrowing-conversions (389 findings, inherent to
# size_t/Eigen::Index/double arithmetic), easily-swappable-parameters (43),
# non-private-member-variables-in-classes (61; the edge and graph structs are
# deliberately plain data) and no-recursion (21).
#
# modernize-* and readability-* stay curated: measured over the whole library
# they report 1233 and ~344k findings, the latter dominated by numeric literals
# in test fixtures. Widening those means fixing the findings first.
#
# WarningsAsErrors is '*', so there is no reported-but-tolerated tier. The
# diff job gives fast feedback; a second job runs the whole library.
#
# To propose a check: add it, run
#   run-clang-tidy-14 -p <build-dir> -checks='-*,<the-new-check>' include/
# and either fix the findings in the same pull request or leave it out.

Checks: >
  -*,
  bugprone-*,
  -bugprone-narrowing-conversions,
  -bugprone-easily-swappable-parameters,
  misc-*,
  -misc-non-private-member-variables-in-classes,
  -misc-no-recursion,
  performance-*,
  portability-*,
  modernize-deprecated-headers,
  modernize-loop-convert,
  modernize-make-shared,
  modernize-make-unique,
  modernize-redundant-void-arg,
  modernize-use-bool-literals,
  modernize-use-emplace,
  modernize-use-equals-default,
  modernize-use-equals-delete,
  modernize-use-nullptr,
  modernize-use-override,
  modernize-use-using,
  readability-const-return-type,
  readability-container-size-empty,
  readability-delete-null-pointer,
  readability-misleading-indentation,
  readability-redundant-control-flow,
  readability-redundant-smartptr-get,
  readability-redundant-string-cstr,
  readability-redundant-string-init,
  readability-simplify-boolean-expr,
  readability-static-definition-in-anonymous-namespace,
  readability-string-compare

WarningsAsErrors: '*'

# Matched against each header's *absolute* path, so this must not be anchored at
# the repository root. The vendored and generated headers are left out via the
# alternation; ExcludeHeaderFilterRegex needs clang-tidy 18.
HeaderFilterRegex: '.*/(include/vinecopulib/(bicop|vinecop)|include/vinecopulib/misc/(tools_(eigen|stl|stats|serialization|interpolation|optimization|transforms|integration|thread|interface|batch|constants|optional)|triangular_array|fit_controls)|test/src_test|benchmarks/src)'

FormatStyle: file
