S3L0006: No pattern names¶
A name says what a thing is, not which pattern it follows.
| Category | Snail |
| Severity | warning — an error under TreatWarningsAsErrors, which every Snail project builds with |
| Analyzer | Naming in Snail.Sdk.Analyzers |
| Code fix | none — the right name is the author's |
What it reports¶
- A type whose name ends in
Service,Manager,Helper,Helpers,Processor,Data,Util,Utils,UtilityorUtilitiesand is longer than the suffix:'OrderService' names a pattern ('Service'), not what the thing is. - A namespace with a segment
Helpers,Utils,Managers,CommonorShared— a folder of that name.
What it leaves alone¶
A type already released in PublicAPI.Shipped.txt: renaming it would break its users, a decision for a major version.
Why¶
OrderService says nothing a reader did not know; Checkout or Orders says what it does. A Helpers folder is
where code goes when nobody decided where it belongs.
How to fix¶
Rename the type for what it is or does (OrderService → Checkout, DateHelper → BusinessDays), and move the
files of a Helpers or Common folder beside the code that uses them.
Suppressing it¶
Fix the code rather than silence the rule: the rule is part of the standard every Snail repository keeps. Where one place truly must differ, suppress that place and say why:
[SuppressMessage("Snail", "S3L0006:No pattern names", Justification = "<why this place differs>")]
A NoWarn in a project or props file would hide the rule from every new line too; the
conformance check reports one as migration debt (S3LC0017).