Crafter.Build/interfaces
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf 6438cb9ebb feat(lint): fixed-width-types keeps widths that a foreign API chose
The rewrite itself stays token-shaped — it edits type SPELLINGS, which an AST
discards — but what it must not touch now comes from the AST.

The old exemption was per LINE: `int main`, `argc`, `argv`, `extern "`. Being a
transform, a missed exemption here does not over-report, it emits code that no
longer matches the API being called, so this is the rule where guessing from
substrings mattered most. And being per-line, it also disabled the rule for
anything sharing a line with one of those words.

Now a declaration with C language linkage, or one whose initialiser binds to an
entity declared outside the project, contributes a protected byte range and
keeps its spelling. That answers the case directly: a function declared in
somebody else's header taking `unsigned int` keeps `unsigned int`, and a local
initialised from strtoul keeps `unsigned long`, because of where those are
declared rather than because of what the line says.

main is protected from the start of its declaration to the opening brace of its
body, not for its whole extent. Its signature is fixed by the language; its body
is ordinary code. Three findings on this repository came out of that
distinction, all correct:

    for (int i = 1; i < argc; ++i)   ->   for (std::int32_t i = 1; ...)

skipped before only because `argc` appeared on the line, plus Crafter::Run's own
`int argc` and return type, which are ours rather than the language's.

All three AST rules now share one interop test instead of carrying a denylist
each, and it is the same test: whose header dictates this spelling.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 23:59:46 +02:00
..
Crafter.Build-Api.h linting 2026-07-23 01:24:42 +02:00
Crafter.Build-Asset.cppm linting 2026-07-23 01:24:42 +02:00
Crafter.Build-Clang.cppm feat(lint): fixed-width-types keeps widths that a foreign API chose 2026-07-30 23:59:46 +02:00
Crafter.Build-External.cppm feat(lint): no-char-pointer reads the AST, retiring the interop denylist 2026-07-30 23:46:32 +02:00
Crafter.Build-Implementation.cppm fix: re-resolve module imports before checking staleness 2026-07-30 17:12:24 +00:00
Crafter.Build-Interface.cppm fix: track what a primary module interface imports 2026-07-30 18:19:04 +00:00
Crafter.Build-Lint.cppm feat(lint): AST layer over libclang cursors 2026-07-30 23:30:41 +02:00
Crafter.Build-Platform.cppm linting 2026-07-23 01:24:42 +02:00
Crafter.Build-Progress.cppm linting 2026-07-23 01:24:42 +02:00
Crafter.Build-Shader.cppm linting 2026-07-23 01:24:42 +02:00
Crafter.Build-Test.cppm linting 2026-07-23 01:24:42 +02:00
Crafter.Build.cppm linting 2026-07-23 01:24:42 +02:00