Skip to content

Gendarme.Rules.Naming.UseSingularNameInEnumsUnlessAreFlagsRule(git)

Sebastien Pouliot edited this page Mar 2, 2011 · 1 revision

UseSingularNameInEnumsUnlessAreFlagsRule

Assembly: Gendarme.Rules.Naming
Version: git

Description

The rule is used for ensure that the name of enumerations are in singular form unless the enumeration is used as flags, i.e. decorated with the Flags attribute.

Examples

Bad example:

public enum MyCustomValues {
    Foo,
    Bar
}

Good example (singular):

public enum MyCustomValue {
    Foo,
    Bar
}

Good example (flags):

[Flags]
public enum MyCustomValues {
    Foo,
    Bar,
    AllValues = Foo | Bar
}

Source code

You can browse the latest source code of this rule on github.com

Clone this wiki locally