---

HeaderFilterRegex: hipop/.*
WarningsAsErrors: '*'

Checks: # See https://clang.llvm.org/extra/clang-tidy/checks/list.html

  - cppcoreguidelines-*
  - misc-include-cleaner # The other misc-* are worth enabling, but that would mean significant code refactoring.
  - modernize-*
  - performance-*

  # This check requires single-argument constructors and conversion operators to be marked as explicit.
  # Disabled because it leaves no way to define an intentional implicit conversion between classes
  # (at least in C++17). To be reconsidered if moving to C++20, where `explicit(false)` can be used
  # to mark an implicit conversion as intentional.
  - -cppcoreguidelines-explicit-constructor

  # This check assumes that each `T&&` function argument (with `T` a template parameter of the function)
  # is meant to be forwarded (see F.19 principle from C++ Core Guidelines, as referred in
  # https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/missing-std-forward.html).
  # Still, `T&&`-arguments may have other roles - typically be used as "universal references"
  # (see Scott Meyers: https://isocpp.org/blog/2012/11/universal-references-in-c11-scott-meyers).
  # In that case, the rule may raise false positives - and blindly applying its suggested
  # fix may even break the code's behavior.
  - -cppcoreguidelines-missing-std-forward

  # FIXME Significant legacy code refactoring would be necessary to address these warnings properly
  # (in particular, it would require to carefully review the integral types used to encode
  # the inputs and outputs of graph algorithm functions).
  - -cppcoreguidelines-narrowing-conversions

  # These checks require to use bounds-checked accessors on containers (e.g. `.at()` instead of `operator[]`).
  # Disabled because of the performance cost in hot loops, and because they raise false positives:
  # the index may be valid by the general logic of the algorithm, even if the checks can't deduce it.
  - -cppcoreguidelines-pro-bounds-avoid-unchecked-container-access
  - -cppcoreguidelines-pro-bounds-constant-array-index

  # Requiring all function definitions to follow the trailing-return-type syntax
  # conflicts with the habits of most C/C++ developers. Moreover, this brings nothing
  # in terms of performance, and the gain in terms of readability is questionable.
  # Reminder:
  # - classic syntax: `int function_name(...) { ... }`
  # - trailing-return-type syntax: `auto function_name(...) -> int { ... }`
  - -modernize-use-trailing-return-type

CheckOptions:

  # The nanobind STL headers provide the C++ <-> Python type casters through template specializations:
  # no symbol from them is referenced directly, but they must be included where the conversions happen.
  misc-include-cleaner.IgnoreHeaders: 'nanobind/stl/.*'
