Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change the severity of a dotnet_naming_style #36312

Closed
SilverPh0ton opened this issue Jun 11, 2019 · 5 comments
Closed

Can't change the severity of a dotnet_naming_style #36312

SilverPh0ton opened this issue Jun 11, 2019 · 5 comments
Assignees
Labels
Area-IDE Bug IDE-CodeStyle Built-in analyzers, fixes, and refactorings Resolution-Answered The question has been answered
Milestone

Comments

@SilverPh0ton
Copy link

SilverPh0ton commented Jun 11, 2019

Version Used:
Visual Studio v16.1.1
dotnet v 2.2.300

Steps to Reproduce:
Add this to the .editorconfig file:
dotnet_naming_style.private_field_style.capitalization = camel_case
dotnet_naming_style.private_field_style.required_prefix = _
dotnet_naming_style.private_field_style.severity = warning

Expected Behavior:
Private field name with no '_' at the beginning should trigger a warning,

Actual Behavior:
Private field name with no '_' at the beginning trigger an error,

@sharwell
Copy link
Member

@SilverPh0ton Does your project have "treat warnings as errors" enabled? Can you post the full content of your .editorconfig file?

@SilverPh0ton
Copy link
Author

We plan to have a "treat warning as errors" on release mode but even with dotnet_naming_style.private_field_style.severity = suggestion
it doesn't work

@SilverPh0ton
Copy link
Author

I have made a reop project if you want to take a look to see what's going on https://github.com/SilverPh0ton/Editorconfig_dotnet_naming_style_severity

@jinujoseph jinujoseph added Area-IDE Bug IDE-CodeStyle Built-in analyzers, fixes, and refactorings Investigation Required labels Jun 11, 2019
@jinujoseph jinujoseph added this to the 16.3 milestone Jun 11, 2019
@sharwell
Copy link
Member

@SilverPh0ton It turns out the editor is following the severity given in .editorconfig:

dotnet_naming_rule.private_fields_should_be_camel_case.severity = error

Severity is a property of dotnet_naming_rule, not dotnet_naming_style.

@sharwell
Copy link
Member

I'm going to close this as answered, but please consider adding a 👍 vote on #19055 if you are interested in having better editor support for these cases.

@sharwell sharwell added Resolution-Answered The question has been answered and removed Investigation Required labels Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug IDE-CodeStyle Built-in analyzers, fixes, and refactorings Resolution-Answered The question has been answered
Projects
None yet
Development

No branches or pull requests

3 participants