-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add the Roslyn naming conventions to .editorconfig #28872
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
Conversation
|
How many warnings are you getting in the IDE with these settings? |
None, for two reasons:
These settings appear at least close to the ones used for the majority of new code. |
333fred
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming changes appear to be consistent with my understanding of the compiler conventions.
| # Project-specific settings: | ||
| [*.{cs,vb}] | ||
| # Local functions are camelCase | ||
| dotnet_naming_style.local_function_style.capitalization = camel_case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might deserve a comment in the parent .editorconfig. If somebody "helpfully" renames the local_function_style to something else, this override might silently disappear. Hopefully that creates warnings, but...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternately, this is a new feature, can't we just agree on this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we just agree on this one?
I'll submit a follow-up issue to try and agree on it, but my understanding is the current form matches the currently-used preferences.
| dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style | ||
|
|
||
| dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field | ||
| dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected internal, private protected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure it must be protected_internal rather than protected internal
| dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields | ||
| dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style | ||
|
|
||
| dotnet_naming_symbols.instance_fields.applicable_kinds = field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be nice to explicitly put the accessibility as "*"
No description provided.