-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.clang-tidy
More file actions
33 lines (33 loc) · 1.78 KB
/
Copy path.clang-tidy
File metadata and controls
33 lines (33 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# clang-tidy configuration for the C++ NIF under c_src/.
#
# Run it with `mix clang.tidy` (which supplies the MLX/Fine/ERTS build
# env) — see lib/mix/tasks/clang.tidy.ex and the `clang-tidy` target in
# the Makefile.
#
# A focused, high-signal set: bug patterns, the clang static analyzer
# (clang-analyzer-*), and performance checks. Deliberately not the
# modernize/readability/cppcoreguidelines firehose yet — broaden once this
# baseline stays green.
#
# Disabled checks and why:
# * bugprone-easily-swappable-parameters — fires on nearly every NIF
# entry point (many same-typed args) without pointing at a real defect.
# * performance-unnecessary-value-param — every NIF takes its
# fine::ResourcePtr args by value because Fine's FINE_NIF macro decodes
# each BEAM term into a value and passes it in; the signature is the
# binding convention, not a stray copy (the cppcheck build suppresses
# the same thing as passedByValueCallback).
# * bugprone-throwing-static-initialization — FINE_NIF / FINE_RESOURCE
# register callbacks at static-init time via throwing constructors;
# this is inherent to Fine's registration model, across ~25 macro
# expansions we don't own.
# * performance-enum-size — Opcode and ref::Kind are int64_t on purpose
# (they pack into the int64 refs the Elixir lowerer emits); shrinking
# the base type would break that ABI.
#
# HeaderFilterRegex scopes diagnostics to our own headers; MLX and Fine
# arrive via -isystem and are skipped, exactly as the compiler skips them.
Checks: '-*,bugprone-*,clang-analyzer-*,performance-*,-bugprone-easily-swappable-parameters,-performance-unnecessary-value-param,-bugprone-throwing-static-initialization,-performance-enum-size'
WarningsAsErrors: '*'
HeaderFilterRegex: 'c_src/'
FormatStyle: none