.editorconfig 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\GithubRepos\QuestPDF codebase based on best match to current usage at 16.03.2022
  2. # You can modify the rules from these initially generated values to suit your own policies
  3. # You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
  4. [*.cs]
  5. #Core editorconfig formatting - indentation
  6. #use soft tabs (spaces) for indentation
  7. indent_style = space
  8. #Formatting - new line options
  9. #place catch statements on a new line
  10. csharp_new_line_before_catch = true
  11. #place else statements on a new line
  12. csharp_new_line_before_else = true
  13. #require members of anonymous types to be on separate lines
  14. csharp_new_line_before_members_in_anonymous_types = true
  15. #require members of object intializers to be on separate lines
  16. csharp_new_line_before_members_in_object_initializers = true
  17. #require braces to be on a new line for object_collection_array_initializers, methods, anonymous_types, control_blocks, types, and lambdas (also known as "Allman" style)
  18. csharp_new_line_before_open_brace =all
  19. #Formatting - organize using options
  20. #sort System.* using directives alphabetically, and place them before other usings
  21. dotnet_sort_system_directives_first = true
  22. #Formatting - spacing options
  23. #require NO space between a cast and the value
  24. csharp_space_after_cast = false
  25. #require a space before the colon for bases or interfaces in a type declaration
  26. csharp_space_after_colon_in_inheritance_clause = true
  27. #require a space after a keyword in a control flow statement such as a for loop
  28. csharp_space_after_keywords_in_control_flow_statements = true
  29. #require a space before the colon for bases or interfaces in a type declaration
  30. csharp_space_before_colon_in_inheritance_clause = true
  31. #remove space within empty argument list parentheses
  32. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  33. #remove space between method call name and opening parenthesis
  34. csharp_space_between_method_call_name_and_opening_parenthesis = false
  35. #do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
  36. csharp_space_between_method_call_parameter_list_parentheses = false
  37. #remove space within empty parameter list parentheses for a method declaration
  38. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  39. #place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
  40. csharp_space_between_method_declaration_parameter_list_parentheses = false
  41. #Formatting - wrapping options
  42. #leave code block on single line
  43. csharp_preserve_single_line_blocks = true
  44. #Style - Code block preferences
  45. #prefer no curly braces if allowed
  46. csharp_prefer_braces = false:suggestion
  47. #Style - expression bodied member options
  48. #prefer block bodies for constructors
  49. csharp_style_expression_bodied_constructors = false:suggestion
  50. #prefer block bodies for methods
  51. csharp_style_expression_bodied_methods = false:suggestion
  52. #prefer expression-bodied members for properties
  53. csharp_style_expression_bodied_properties = true:suggestion
  54. #Style - expression level options
  55. #prefer out variables to be declared inline in the argument list of a method call when possible
  56. csharp_style_inlined_variable_declaration = true:suggestion
  57. #prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
  58. dotnet_style_predefined_type_for_member_access = true:suggestion
  59. #Style - Expression-level preferences
  60. #prefer objects to be initialized using object initializers when possible
  61. dotnet_style_object_initializer = true:suggestion
  62. #prefer inferred anonymous type member names
  63. dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion
  64. #prefer inferred tuple element names
  65. dotnet_style_prefer_inferred_tuple_names = true:suggestion
  66. #Style - implicit and explicit types
  67. #prefer var over explicit type in all cases, unless overridden by another code style rule
  68. csharp_style_var_elsewhere = true:suggestion
  69. #prefer var is used to declare variables with built-in system types such as int
  70. csharp_style_var_for_built_in_types = true:suggestion
  71. #prefer var when the type is already mentioned on the right-hand side of a declaration expression
  72. csharp_style_var_when_type_is_apparent = true:suggestion
  73. #Style - language keyword and framework type options
  74. #prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them
  75. dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
  76. #Style - Miscellaneous preferences
  77. #prefer local functions over anonymous functions
  78. csharp_style_pattern_local_over_anonymous_function = true:suggestion
  79. #Style - modifier options
  80. #prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods.
  81. dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
  82. #Style - Modifier preferences
  83. #when this rule is set to a list of modifiers, prefer the specified ordering.
  84. csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
  85. #Style - Pattern matching
  86. #prefer pattern matching instead of is expression with type casts
  87. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  88. #Style - qualification options
  89. #prefer fields not to be prefaced with this. or Me. in Visual Basic
  90. dotnet_style_qualification_for_field = false:suggestion
  91. #prefer methods not to be prefaced with this. or Me. in Visual Basic
  92. dotnet_style_qualification_for_method = false:suggestion
  93. #prefer properties not to be prefaced with this. or Me. in Visual Basic
  94. dotnet_style_qualification_for_property = false:suggestion
  95. [*.{cs,vb}]
  96. tab_width=4
  97. indent_size=4