I'm writing an editorconfig file to enforce some coding styles and I'd like to enforce that constants should be uppercase, so I created the following rules in the editorConfig file:
dotnet_naming_rule.constants_must_be_uppercase.symbols = public_constants
dotnet_naming_symbols.public_constants.applicable_kinds = field
dotnet_naming_symbols.public_constants.applicable_accessibilities = *
dotnet_naming_symbols.public_constants.required_modifiers = const
dotnet_naming_rule.constants_must_be_uppercase.style = uppercase_with_underscore_separator
dotnet_naming_style.uppercase_with_underscore_separator.capitalization = all_upper
dotnet_naming_style.uppercase_with_underscore_separator.word_separator = _
dotnet_naming_rule.constants_must_be_uppercase.severity = warning
I'm testing this with the following code:
namespace XYZ
{
public class Foo
{
public const string Bar = "bar";
}
}
However, Visual Studio does not indicate that the line is not correct. Is it a bug or is my file incorrect?