Crafter.Build/tests
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
..
CleanProject fix: key the host PCM cache on source content, add clean, hash project args 2026-07-30 17:43:09 +00:00
ConcurrentCacheRace linting 2026-07-23 01:24:42 +02:00
ConcurrentDependencyReset linting 2026-07-23 01:24:42 +02:00
DependencyLink linting 2026-07-23 01:24:42 +02:00
HelloWorld linting 2026-07-23 01:24:42 +02:00
HostCacheSourceStamp fix: key the host PCM cache on source content, add clean, hash project args 2026-07-30 17:43:09 +00:00
HouseRules feat(lint): fixed-width-types keeps widths that a foreign API chose 2026-07-30 23:59:46 +02:00
IncrementalInterfaceChange fix: re-resolve module imports before checking staleness 2026-07-30 17:12:24 +00:00
Lint feat(lint): AST layer over libclang cursors 2026-07-30 23:30:41 +02:00
ModuleInterface linting 2026-07-23 01:24:42 +02:00
RunSingleTestExit linting 2026-07-23 01:24:42 +02:00
ShaderCompile linting 2026-07-23 01:24:42 +02:00
StandardArgs fix: key the host PCM cache on source content, add clean, hash project args 2026-07-30 17:43:09 +00:00
StaticLib linting 2026-07-23 01:24:42 +02:00
TestRunnerSpec linting 2026-07-23 01:24:42 +02:00
TransitiveInterfaceChange fix: track what a primary module interface imports 2026-07-30 18:19:04 +00:00
VariantId fix: key the host PCM cache on source content, add clean, hash project args 2026-07-30 17:43:09 +00:00
WasiBrowserRuntime linting 2026-07-23 01:24:42 +02:00
WasmVariants linting 2026-07-23 01:24:42 +02:00