Microsoft.CodeAnalysis.FxCopAnalyzers
CA1717
Add a non-flags enumeration with a suffix of "Status", such as ViewStatus
No violation, since "status" is not generally accepted as a pluralization.
warning CA1717: Only FlagsAttribute enums should have plural names
Thank you, @kentcb! Reproduced and confirmed
In accordance with https://msdn.microsoft.com/en-us/library/bb264486.aspx:
When to Suppress Warnings
It is safe to suppress a violation if the name is a plural word but does not end in 's'. For example, if the multiple-day enumeration that was described previously were named 'DaysOfTheWeek', this would violate the logic of the rule but not its intent. Such violations should be suppressd.
As far as I know, there are no plans to add specific checks for words ending with 's'. So, you can safely suppress the warning. Thank you!
Here's me thinking the heuristic would be more sophisticated than an EndsWith("s") 馃槅
We recently started using Humanizer for plurality naming suggestions in the IDE. @rchande, do you think it would be possible to use that for this application as well?
@333fred Definitely! They have pretty comprehensive heuristics for checking if a word is plural.
This should be done.
If I have to go to every occurrence of violations of this rule to suppress the rule, it makes the rule useless.
Humanizer's plurality rules are here:
It seems they're only available for en-US.
This should be done.
If I have to go to every occurrence of violations of this rule to suppress the rule, it makes the rule useless.
"Useless" is strong, but given how common "Status" is, it would seem sensible to add an exception for. Even "-us" - I suspect there's very few English words likely to be used to name an Enum that have a plural ending in -us.
Most helpful comment
Here's me thinking the heuristic would be more sophisticated than an
EndsWith("s")馃槅