Skip to content

IDE1006 Naming rule for local variables does not work #80696

@Mr1008

Description

@Mr1008

Version Used: .NET SDK 10.0.100-rc.1.25451.107

Steps to Reproduce:

  1. Set following rule in .editorconfig file:
dotnet_naming_rule.locals_should_be_camel_case = error
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case

dotnet_naming_symbols.locals.applicable_kinds = local
dotnet_naming_symbols.locals.applicable_accessibilities = local

dotnet_naming_style.camel_case.capitalization = camel_case

dotnet_diagnostic.IDE1006.severity = error
  1. try to declare such local variable in a method:
var ThisIsTheTest = 1;
  1. Observe the analyzer does not report issue with name being PascalCase instead of camelCase.

Diagnostic Id:

IDE1006

Expected Behavior:
The naming rules should be applied to local variables.

Actual Behavior:
Local variables are not detected, despite being configured correctly in .editorconfig.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions