Crafter.Build/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf 649d64ae12 fix(lint): constexpr-constant asks clang's evaluator, not the initialiser tokens
The first cut scanned the initialiser's tokens and required every one to be a
literal or an operator. That is exactly the kind of approximation this work has
been removing, and it was wrong in both directions:

  const int A = sizeof(Big);   missed — `sizeof` is a keyword
  const int B = Base + 1;      missed — `Base` is an identifier
  const auto C = 5_notConstexpr;  would have been reported, wrongly

clang_Cursor_Evaluate answers the question directly. Evaluating a variable
declaration evaluates its initialiser, so anything that folds is recognised and
a call result still is not. Costs nothing measurable — lint stays at ~15s.

Found one real case the token version could not see: an EShMessages fold over
three glslang enum constants in Crafter.Build-Shader.cpp. Promoting it to
constexpr then made `naming` ask for constant naming, since a constexpr
variable is a compile-time constant — so it is `Messages` now. Two rules
agreeing on the same declaration is the intended behaviour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 02:05:37 +02:00
..
CleanProject feat(lint): const-local and constexpr-constant rules 2026-07-31 00:50:48 +02: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 fix(lint): constexpr-constant asks clang's evaluator, not the initialiser tokens 2026-07-31 02:05:37 +02:00
IncrementalInterfaceChange fix: re-resolve module imports before checking staleness 2026-07-30 17:12:24 +00:00
Lint feat(lint): const-local and constexpr-constant rules 2026-07-31 00:50:48 +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