Roslyn: "pascal_case" capatilization style only enforces "first_word_upper"

Created on 11 Dec 2017  路  5Comments  路  Source: dotnet/roslyn

.EditorConfig

# Dotnet code style settings:
[*.{cs,vb}]
dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.symbols   = externally_visible_symbols
dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.style    = pascal_case_style
dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.severity = warning

# Symbols
dotnet_naming_symbols.externally_visible_symbols.applicable_kinds           = class,struct,interface,enum,property,method,field,event,delegate
dotnet_naming_symbols.externally_visible_symbols.applicable_accessibilities = public,internal,friend,protected,protected_internal,protected_friend,private_protected

Code:
``` C#

class Program
{
    public string Bar_foo
    {
        get;
    }

    public string BAR_FOO
    {
        get;
    }
}

```

Expected: 2 warnings
Actual: No warning

Area-IDE Bug Developer Community

Most helpful comment

The same problem happens with "camel_case", I'd expect this to be flagged when using it: foo_bar.

All 5 comments

The same problem happens with "camel_case", I'd expect this to be flagged when using it: foo_bar.

Yup. That seems odd!

also reported link

The above link is closed in favor of this one, but it provides another case, where symbols beginning with an underscore don't trigger a violation for pascal_case
image

@MisinformedDNA That issue is a duplicate of #26588, which is nearly approved for the design at this point.

Was this page helpful?
0 / 5 - 0 ratings