Browse pages
LS5004: Mark Uses the Undeclared Style
LS5004 is a compiler check that reports a mark written in the style the project did not declare, because two styles in one project send each search to half the code. This page states what the rule reports, where the error sits, and how to write the mark in the declared style.
Reference#
What the Rule Enforces#
LS5004 enforces Write Each Mark in the Declared Style (litespec/backend/dotnet/stack#write-each-mark-in-the-declared-style). It runs in every layer, on every marked code element and test. Its category is LiteSpec.Traceability.
What the Rule Reports#
The rule reports an implements or proves documentation tag when the project declares attribute, and an Implements or Proves attribute when the project declares xml. The Claimwick product declares "marks": "xml", so its marks are documentation tags. The diagnostic sits on the mark.
Failing Example#
[Implements("use-case/spending.submit-expense")]
internal sealed class SubmitExpenseCommandHandler(...)
: ICommandHandler<SubmitExpenseCommand, SubmitExpenseCommandResult>
{
// Loads the expense, submits it, stages it, and returns the result.
}Passing Example#
/// <implements>use-case/spending.submit-expense</implements>
internal sealed class SubmitExpenseCommandHandler(...)
: ICommandHandler<SubmitExpenseCommand, SubmitExpenseCommandResult>
{
// Loads the expense, submits it, stages it, and returns the result.
}How to Fix#
Write the mark in the declared style. A code fix converts the mark to the declared style, with Fix All.
Notes#
What the Rule Ignores#
The rule does not report a mark written in the declared style. It reads C# only; frontend litespec constants are checked by litespec model check. The rule stays silent when no .litespec/project.json is in reach, or when the docs root it names cannot be resolved; the CLI owns that configuration error.
Severity#
The rule reports an error. A finding that a live exception covers stays silent. An .editorconfig entry for the rule id overrides the computed severity.