Files
ASP.NET-Core-Clean-Architec…/.editorconfig
T
2023-09-16 15:52:59 -03:00

408 lines
18 KiB
INI

###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style = space
# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2
# JSON files
[*.json]
indent_size = 2
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = false
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
###############################
# .NET Diagnostic #
###############################
# Simplify name
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0001
dotnet_diagnostic.IDE0001.severity = warning
# Simplify member access
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0002
dotnet_diagnostic.IDE0002.severity = warning
# this and Me preferences
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0003-ide0009
dotnet_diagnostic.IDE0003.severity = warning
# Remove unnecessary cast
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0004
dotnet_diagnostic.IDE0004.severity = warning
# Remove unnecessary using directives
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005
dotnet_diagnostic.IDE0005.severity = warning
# Prefer "var" everywhere
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0007-ide0008
dotnet_diagnostic.IDE0007.severity = warning
# Use throw expression
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0016
dotnet_diagnostic.IDE0016.severity = warning
# Use object initializers
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0017
dotnet_diagnostic.IDE0017.severity = warning
# Inline variable declaration
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0018
dotnet_diagnostic.IDE0018.severity = warning
# Collection initialization can be simplified
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0028
dotnet_diagnostic.IDE0028.severity = warning
# Null check can be simplified
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0029-ide0030-ide0270
dotnet_diagnostic.IDE0029.severity = warning
dotnet_diagnostic.IDE0030.severity = warning
dotnet_diagnostic.IDE0270.severity = warning
# Use null propagation
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0031
dotnet_diagnostic.IDE0031.severity = warning
# Use auto-implemented property
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0032
dotnet_diagnostic.IDE0032.severity = warning
# Use explicitly provided tuple name
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0033
dotnet_diagnostic.IDE0033.severity = warning
# Simplify 'default' expression
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0034
dotnet_diagnostic.IDE0034.severity = warning
# Remove unreachable code
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0035
dotnet_diagnostic.IDE0035.severity = warning
# Order modifiers
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036
dotnet_diagnostic.IDE0036.severity = warning
# Use local function instead of lambda
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0039
dotnet_diagnostic.IDE0039.severity = warning
# Add accessibility modifiers
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0040
dotnet_diagnostic.IDE0040.severity = warning
# Deconstruct variable declaration
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0042
dotnet_diagnostic.IDE0042.severity = warning
# Make field readonly
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0044
dotnet_diagnostic.IDE0044.severity = warning
# Use conditional expression for assignment
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0045
dotnet_diagnostic.IDE0045.severity = warning
# Parentheses can be removed
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0047-ide0048
dotnet_diagnostic.IDE0047.severity = warning
# Use language keywords instead of framework type names for type references
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0049
dotnet_diagnostic.IDE0049.severity = warning
# Remove unused private member
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0051
dotnet_diagnostic.IDE0051.severity = warning
# Remove unread private member
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0052
dotnet_diagnostic.IDE0052.severity = warning
# Use compound assignment
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0054-ide0074
dotnet_diagnostic.IDE0054.severity = warning
# Unnecessary assignment to a value
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0059
dotnet_diagnostic.IDE0059.severity = warning
# Remove unused parameter
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0060
dotnet_diagnostic.IDE0060.severity = warning
# Make local function static
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0062
dotnet_diagnostic.IDE0062.severity = warning
# Use simple 'using' statement
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0063
dotnet_diagnostic.IDE0063.severity = warning
# Simplify interpolation
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0071
dotnet_diagnostic.IDE0071.severity = warning
# Simplify conditional expression
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0075
dotnet_diagnostic.IDE0075.severity = warning
# Simplify new expression
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0090
dotnet_diagnostic.IDE0090.severity = warning
# Convert to file-scoped namespace
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161
dotnet_diagnostic.IDE0161.severity = warning
# Prefer extended property pattern
# https://learn.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0170
dotnet_diagnostic.IDE0170.severity = warning
# Use conditional delegate call
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide1005
dotnet_diagnostic.IDE1005.severity = warning
# Abstract types should not have public constructors
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1012
dotnet_diagnostic.CA1012.severity = warning
# Make member static
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
dotnet_diagnostic.CA1822.severity = warning
###############################
# .NET Coding Conventions #
###############################
[*.{cs,vb}]
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# this. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = non_private_static_field_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
# Whitespace options
dotnet_style_allow_multiple_blank_lines_experimental = false
# Non-private static fields are PascalCase
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
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
dotnet_naming_symbols.non_private_static_fields.required_modifiers = static
dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
# Non-private readonly fields are PascalCase
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_static_field_style
dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
dotnet_naming_style.non_private_readonly_field_style.capitalization = pascal_case
# Constants are PascalCase
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = camel_case_style
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_style.constant_style.capitalization = camel_case
# Static fields are camelCase
dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_camel_case.style = non_private_static_field_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_style.static_field_style.capitalization = pascal_case
# Instance fields are camelCase and start with _
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
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
dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix = _
# Locals and parameters are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
dotnet_naming_style.camel_case_style.capitalization = camel_case
# Local functions are PascalCase
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
dotnet_naming_rule.local_functions_should_be_pascal_case.style = non_private_static_field_style
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
dotnet_naming_style.local_function_style.capitalization = pascal_case
# By default, name items with PascalCase
dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
dotnet_naming_rule.members_should_be_pascal_case.style = non_private_static_field_style
dotnet_naming_symbols.all_members.applicable_kinds = *
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
tab_width = 4
###############################
# C# Coding Conventions #
###############################
[*.cs]
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# Expression-level preferences
csharp_prefer_braces = true:silent
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
###############################
# C# Formatting Rules #
###############################
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = file_scoped:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
###############################
# VB Coding Conventions #
###############################
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion