.editorconfig 2.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. [*.cs]
  2. # Prevent IDE1006 (Naming rule violation) errors for non-public fields.
  3. #
  4. # Unfortunately, the codebase has not historically been entirely consistent with internal naming
  5. # conventions. Apparently this wasn't noticed by older analyzer tooling, but as of the .NET 7
  6. # era, the naming rules analyzers are a bit more particular, and cannot be configured in a way
  7. # that makes them happy with the code as it stands. We could rename all the relevant symbols,
  8. # but that doesn't seem like an especially good use of time, so for now, we're suppressing
  9. # diagnostics in certain cases.
  10. #
  11. # Static readonly fields
  12. #dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.severity = none
  13. # Internal fields
  14. dotnet_naming_symbols.internal_field_symbols.applicable_kinds = field
  15. dotnet_naming_symbols.internal_field_symbols.applicable_accessibilities = internal
  16. dotnet_naming_rule.internal_instance_fields_must_be_camel_cased_underscore_prefix.symbols = internal_field_symbols
  17. dotnet_naming_rule.internal_instance_fields_must_be_camel_cased_underscore_prefix.style = camel_case_and_prefix_with_underscore_style
  18. #dotnet_naming_rule.internal_instance_fields_must_be_camel_cased_underscore_prefix.severity = none
  19. # Protected fields
  20. # Annoyingly, a protected field in an internal class cannot be distinguished from a protected field in a public
  21. # class. That's unfortunate, because the latter are publicly visible, but the former are not, so we don't really
  22. # want to enforce public naming conventions on them. We generally avoid publicly visible fields, so the majority
  23. # of protected fields are in fact in internal types, so we use naming conventions appropriate to those.
  24. dotnet_naming_symbols.protected_field_symbols.applicable_kinds = field
  25. dotnet_naming_symbols.protected_field_symbols.applicable_accessibilities = protected
  26. dotnet_naming_rule.protected_instance_fields_must_be_camel_cased_underscore_prefix.symbols = protected_field_symbols
  27. dotnet_naming_rule.protected_instance_fields_must_be_camel_cased_underscore_prefix.style = camel_case_and_prefix_with_underscore_style
  28. dotnet_naming_rule.protected_instance_fields_must_be_camel_cased_underscore_prefix.severity = none