# conformallab++ clang-tidy policy
#
# Curated, deliberately small.  The CGAL header tree triggers tens of
# thousands of warnings under default settings (CGAL's chosen style is
# pre-C++17 in many places).  Restricting to checks that fire on OUR
# code, not on transitive CGAL/Eigen/Boost headers, keeps the signal
# meaningful.
#
# Promotion gate: a check moves into this list only when (a) it fires
# on code we authored AND (b) the fix is mechanical (no algorithmic
# rewrite required).  Anything algorithmic belongs in a code review,
# not in a static analyser.

Checks: >
  -*,
  bugprone-too-small-loop-variable,
  bugprone-use-after-move,
  bugprone-undefined-memory-manipulation,
  bugprone-integer-division,
  bugprone-suspicious-string-compare,
  bugprone-misplaced-widening-cast,
  bugprone-sizeof-expression,
  cppcoreguidelines-init-variables,
  cppcoreguidelines-pro-type-member-init,
  performance-for-range-copy,
  performance-implicit-conversion-in-loop,
  performance-unnecessary-copy-initialization,
  performance-unnecessary-value-param,
  readability-misleading-indentation,
  readability-redundant-smartptr-get,
  modernize-use-nullptr,
  modernize-use-override,
  modernize-deprecated-headers

# Only emit warnings on our own headers.  CGAL/Eigen/etc. live under
# `code/deps/` (vendored) or are installed system-wide; we never want
# clang-tidy fixes for them.
HeaderFilterRegex: '^.*/code/include/(?!deps/).*$'

WarningsAsErrors: ''

CheckOptions:
  - { key: cppcoreguidelines-init-variables.IgnoreArrays, value: true }
  - { key: performance-for-range-copy.WarnOnAllAutoCopies, value: true }
  - { key: performance-unnecessary-value-param.AllowedTypes, value: 'Eigen::Vector.*;Eigen::Matrix.*' }
