# clang-tidy for the C extension. We enable the deterministic, low-false-positive
# diagnostic families — compiler diagnostics, bug patterns, performance, portability —
# and turn every remaining warning into an error so the gate is binary. clang-diagnostic-*
# surfaces the same -Wall/-Wextra warnings the compile_commands.json flags (warning_level=2)
# carry, so unused/comment/fallthrough/unsequenced slips fail the local hook too; -Wpedantic
# is not in those flags, so the API-mandated void*/function-pointer slot casts stay quiet.
#
# Disabled sub-checks are either opinionated style (easily-swappable-parameters,
# assignment-in-if-condition), inherent to the Python C API (reserved-identifier
# for the _Py* names, multi-level-implicit-pointer-conversion for PyObject casts),
# or noisy in C (narrowing-conversions). The clang-analyzer whole-program dataflow
# family is intentionally left out of this gate: it false-positives on the
# generated tag table and the width-tagged th_buf union, and is better run as a
# separate scan-build pass.
Checks: >
  -*, clang-diagnostic-*, bugprone-*, performance-*, portability-*, -bugprone-easily-swappable-parameters, -bugprone-reserved-identifier, -bugprone-multi-level-implicit-pointer-conversion, -bugprone-narrowing-conversions, -bugprone-assignment-in-if-condition

WarningsAsErrors: "*"
HeaderFilterRegex: "src/turbohtml/_c/.*\\.h$"
