Editorconfig class naming conventions and casing - allow any

Viewed 191

Is it possible to allow editorconfig to be laxer around class name conventions?

According to the docs

You must specify a capitalization style as part of your naming style, otherwise your naming style might be ignored.

I really want to allow different naming conventions in my test files. So I came up with the following:

dotnet_naming_symbols.class_group.applicable_kinds = class
dotnet_naming_style.class_underscore_tolerant.capitalization = TAKE_YOUR_PICK
dotnet_naming_style.class_underscore_tolerant.word_separator = _

dotnet_naming_rule.class_rule.symbols = class_group
dotnet_naming_rule.class_rule.style = class_underscore_tolerant
dotnet_naming_rule.class_rule.severity = warning

The possible values for capitalization are pascal_case, camel_case, first_word_upper, all_upper, all_lower.

I was hoping to allow names such as Foo_spec and foo_setup in the same files. My scenario is where I have nested classes, so something like the following is acceptable:

public class Foo_spec
{
    public class A_Foo
    {
        public class named_Bob
        {
            ...
        }
    }
}

Is this possible?

I don't want to remove the rule - because at least in Rider it falls back to the IDE suggestions.

0 Answers
Related