.editorconfig 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. [*.{sln,csproj}]
  2. end_of_line = crlf
  3. charset = utf-8-bom
  4. [*.sln]
  5. indent_style = tab
  6. [*.{csproj,props,targets,nuspec,resx}]
  7. indent_style = space
  8. indent_size = 2
  9. [*.cs]
  10. indent_style = space
  11. indent_size = 4
  12. insert_final_newline = true
  13. trim_trailing_whitespace = true
  14. max_line_length = 120
  15. csharp_indent_case_contents_when_block = false
  16. csharp_new_line_before_open_brace = all
  17. csharp_new_line_before_else = true
  18. csharp_new_line_before_catch = true
  19. csharp_new_line_before_finally = true
  20. csharp_new_line_before_members_in_object_initializers = true
  21. csharp_new_line_before_members_in_anonymous_types = true
  22. dotnet_style_require_accessibility_modifiers = always
  23. # Diagnostics to prevent defensive copies of `in` struct parameters
  24. resharper_possibly_impure_method_call_on_readonly_variable_highlighting = error
  25. # IDE0040: Add accessibility modifiers
  26. dotnet_diagnostic.IDE0040.severity = warning
  27. # IDE1006: Naming rule violation
  28. dotnet_diagnostic.IDE1006.severity = suggestion
  29. # Severity levels for dotnet_naming_rule only affect IDE environments.
  30. # To have them extra visible to people, we can set them as 'warning' here without affecting compilation.
  31. # Everything should be PascalCase by default
  32. dotnet_naming_rule.all_should_be_camel_case.severity = warning
  33. dotnet_naming_rule.all_should_be_camel_case.symbols = all
  34. dotnet_naming_rule.all_should_be_camel_case.style = pascal_case_style
  35. # Non-public fields should be _camelCase
  36. dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.severity = warning
  37. dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.symbols = non_public_fields
  38. dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.style = underscore_camel_case_style
  39. # Constant fields (and local vars) should be PascalCase
  40. dotnet_naming_rule.constants_should_be_pascal_case.severity = warning
  41. dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
  42. dotnet_naming_rule.constants_should_be_pascal_case.style = pascal_case_style
  43. # Locals variables should be camelCase
  44. dotnet_naming_rule.local_vars_should_be_camel_case.severity = warning
  45. dotnet_naming_rule.local_vars_should_be_camel_case.symbols = local_vars
  46. dotnet_naming_rule.local_vars_should_be_camel_case.style = camel_case_style
  47. # Parameters should be camelCase
  48. dotnet_naming_rule.parameters_should_be_camel_case.severity = warning
  49. dotnet_naming_rule.parameters_should_be_camel_case.symbols = parameters
  50. dotnet_naming_rule.parameters_should_be_camel_case.style = camel_case_style
  51. dotnet_naming_symbols.all.applicable_kinds = *
  52. dotnet_naming_symbols.local_vars.applicable_kinds = local
  53. dotnet_naming_symbols.parameters.applicable_kinds = parameter
  54. dotnet_naming_symbols.constants.applicable_kinds = field, local
  55. dotnet_naming_symbols.constants.required_modifiers = const
  56. dotnet_naming_symbols.non_public_fields.applicable_kinds = field
  57. dotnet_naming_symbols.non_public_fields.applicable_accessibilities = private, protected, private_protected
  58. dotnet_naming_style.camel_case_style.capitalization = camel_case
  59. dotnet_naming_style.camel_case_style.required_prefix =
  60. dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case
  61. dotnet_naming_style.underscore_camel_case_style.required_prefix = _
  62. dotnet_naming_style.pascal_case_style.capitalization = pascal_case
  63. dotnet_naming_style.pascal_case_style.required_prefix =