Type Name | FLTFY04_DescriptorAttributeAnalyzer |
Diagnostic Id | FLTFY04 |
Category | Naming |
Severity | Warning |
Is Enabled By Default | Yes |
The value provided for the Descriptor
will be used as the name of the extension method and must adhere to the standard C# .NET naming conventions for methods.
A violation of this rule occurs when the value provided for the Descriptor
attribute does not adhere to the naming conventions for methods in C# .NET, evaluated based on the following expression: ^[A-Z][a-zA-Z0-9]*$
For example:
[Descriptor("Assign Value")]
public string Property { get; set; }
In this example, the value Assign Value
is not suitable for use as an extension method name as it does not adhere to the C# .NET naming conventions for methods.
Provide a value for the Descriptor
attribute that adheres to the standard C# .NET naming conventions for methods.
For example:
[Descriptor("AssignValue")]
public string Property { get; set; }
Warnings from this rule should be suppressed only if there is a strong justification for using a non-standard name as the Descriptor
. Even when suppressed, Fluentify will not apply the non-standard name.
If suppression is desired, one of the following approaches can be used:
#pragma warning disable FLTFY04 // Descriptor must adhere to the naming conventions for Methods
[Descriptor("Assign Value")]
public string Property { get; set; }
#pragma warning restore FLTFY04 // Descriptor must adhere to the naming conventions for Methods
or alternatively:
[Descriptor("Assign Value")]
[SuppressMessage("Naming", "FLTFY04:Descriptor must adhere to the naming conventions for Methods", Justification = "Explanation for suppression")]
public string Property { get; set; }
It is not recommended to disable the rule, as this may result in some confusion if expected extension methods are not present.
# Disable FLTFY04: Descriptor must adhere to the naming conventions for Methods
[*.cs]
dotnet_diagnostic.FLTFY04.severity = none