Browse Source

Update to latest config/ruleset

pull/1606/head
James Jackson-South 5 years ago
parent
commit
14954cf5f2
  1. 143
      .editorconfig
  2. 2
      shared-infrastructure

143
.editorconfig

@ -1,5 +1,5 @@
# Version: 1.6.2 (Using https://semver.org/) # Version: 2.1.0 (Using https://semver.org/)
# Updated: 2020-11-02 # Updated: 2021-03-03
# See https://github.com/RehanSaeed/EditorConfig/releases for release notes. # See https://github.com/RehanSaeed/EditorConfig/releases for release notes.
# See https://github.com/RehanSaeed/EditorConfig for updates to this file. # See https://github.com/RehanSaeed/EditorConfig for updates to this file.
# See http://EditorConfig.org for more information about .editorconfig files. # See http://EditorConfig.org for more information about .editorconfig files.
@ -60,87 +60,84 @@ indent_size = 2
[*.{cmd,bat}] [*.{cmd,bat}]
end_of_line = crlf end_of_line = crlf
# Bash Files
[*.sh]
end_of_line = lf
# Makefiles # Makefiles
[Makefile] [Makefile]
indent_style = tab indent_style = tab
########################################## ##########################################
# File Header (Uncomment to support file headers) # Default .NET Code Style Severities
# https://docs.microsoft.com/visualstudio/ide/reference/add-file-header # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope
########################################## ##########################################
# [*.{cs,csx,cake,vb,vbx,tt,ttinclude}] [*.{cs,csx,cake,vb,vbx}]
file_header_template = Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2.0. # Default Severity for all .NET Code Style rules below
dotnet_analyzer_diagnostic.severity = warning
# SA1636: File header copyright text should match
# Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project.
# dotnet_diagnostic.SA1636.severity = none
########################################## ##########################################
# .NET Language Conventions # Language Rules
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules
########################################## ##########################################
# .NET Code Style Settings # .NET Style Rules
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#net-style-rules
[*.{cs,csx,cake,vb,vbx}] [*.{cs,csx,cake,vb,vbx}]
# "this." and "Me." qualifiers # "this." and "Me." qualifiers
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
dotnet_style_qualification_for_field = true:warning dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_property = true:warning dotnet_style_qualification_for_property = true:warning
dotnet_style_qualification_for_method = true:warning dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_event = true:warning dotnet_style_qualification_for_event = true:warning
# Language keywords instead of framework type names for type references # Language keywords instead of framework type names for type references
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords
dotnet_style_predefined_type_for_locals_parameters_members = true:warning dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning dotnet_style_predefined_type_for_member_access = true:warning
# Modifier preferences # Modifier preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers
dotnet_style_require_accessibility_modifiers = always:warning dotnet_style_require_accessibility_modifiers = always:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
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:warning 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:warning
dotnet_style_readonly_field = true:warning dotnet_style_readonly_field = true:warning
# Parentheses preferences # Parentheses preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion dotnet_style_parentheses_in_other_operators = always_for_clarity:suggestion
# Expression-level preferences # Expression-level preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
dotnet_style_object_initializer = true:warning dotnet_style_object_initializer = true:warning
dotnet_style_collection_initializer = true:warning dotnet_style_collection_initializer = true:warning
dotnet_style_explicit_tuple_names = true:warning dotnet_style_explicit_tuple_names = true:warning
dotnet_style_prefer_inferred_tuple_names = true:warning dotnet_style_prefer_inferred_tuple_names = true:warning
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
dotnet_style_prefer_auto_properties = true:warning dotnet_style_prefer_auto_properties = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion
dotnet_diagnostic.IDE0045.severity = suggestion
dotnet_style_prefer_conditional_expression_over_return = false:suggestion dotnet_style_prefer_conditional_expression_over_return = false:suggestion
dotnet_diagnostic.IDE0046.severity = suggestion
dotnet_style_prefer_compound_assignment = true:warning dotnet_style_prefer_compound_assignment = true:warning
dotnet_style_prefer_simplified_interpolation = true:warning
dotnet_style_prefer_simplified_boolean_expressions = true:warning
# Null-checking preferences # Null-checking preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences
dotnet_style_coalesce_expression = true:warning dotnet_style_coalesce_expression = true:warning
dotnet_style_null_propagation = true:warning dotnet_style_null_propagation = true:warning
# Parameter preferences dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences # File header preferences
dotnet_code_quality_unused_parameters = all:warning file_header_template = Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2.0.
# More style options (Undocumented) # SA1636: File header copyright text should match
# https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641 # Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project.
# dotnet_diagnostic.SA1636.severity = none
# Undocumented
dotnet_style_operator_placement_when_wrapping = end_of_line dotnet_style_operator_placement_when_wrapping = end_of_line
# https://github.com/dotnet/roslyn/pull/40070
dotnet_style_prefer_simplified_interpolation = true:warning
# C# Code Style Settings # C# Style Rules
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#c-style-rules
[*.{cs,csx,cake}] [*.{cs,csx,cake}]
# Implicit and explicit types # 'var' preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types
csharp_style_var_for_built_in_types = never csharp_style_var_for_built_in_types = never
csharp_style_var_when_type_is_apparent = true:warning csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = false:warning csharp_style_var_elsewhere = false:warning
# Expression-bodied members # Expression-bodied members
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
csharp_style_expression_bodied_methods = true:warning csharp_style_expression_bodied_methods = true:warning
csharp_style_expression_bodied_constructors = true:warning csharp_style_expression_bodied_constructors = true:warning
csharp_style_expression_bodied_operators = true:warning csharp_style_expression_bodied_operators = true:warning
@ -149,47 +146,64 @@ csharp_style_expression_bodied_indexers = true:warning
csharp_style_expression_bodied_accessors = true:warning csharp_style_expression_bodied_accessors = true:warning
csharp_style_expression_bodied_lambdas = true:warning csharp_style_expression_bodied_lambdas = true:warning
csharp_style_expression_bodied_local_functions = true:warning csharp_style_expression_bodied_local_functions = true:warning
# Pattern matching # Pattern matching preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching
csharp_style_pattern_matching_over_is_with_cast_check = true:warning csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_pattern_matching_over_as_with_null_check = true:warning csharp_style_pattern_matching_over_as_with_null_check = true:warning
# Inlined variable declarations csharp_style_prefer_switch_expression = true:warning
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations csharp_style_prefer_pattern_matching = true:warning
csharp_style_inlined_variable_declaration = true:warning csharp_style_prefer_not_pattern = true:warning
# Expression-level preferences # Expression-level preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences csharp_style_inlined_variable_declaration = true:warning
csharp_prefer_simple_default_expression = true:warning csharp_prefer_simple_default_expression = true:warning
csharp_style_pattern_local_over_anonymous_function = true:warning
csharp_style_deconstructed_variable_declaration = true:warning
csharp_style_prefer_index_operator = true:warning
csharp_style_prefer_range_operator = true:warning
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
# "Null" checking preferences # "Null" checking preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences
csharp_style_throw_expression = true:warning csharp_style_throw_expression = true:warning
csharp_style_conditional_delegate_call = true:warning csharp_style_conditional_delegate_call = true:warning
# Code block preferences # Code block preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences
csharp_prefer_braces = true:warning csharp_prefer_braces = true:warning
# Unused value preferences csharp_prefer_simple_using_statement = true:suggestion
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences dotnet_diagnostic.IDE0063.severity = suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion # 'using' directive preferences
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
# Index and range preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
csharp_style_prefer_index_operator = true:warning
csharp_style_prefer_range_operator = true:warning
# Miscellaneous preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
csharp_style_deconstructed_variable_declaration = true:warning
csharp_style_pattern_local_over_anonymous_function = true:warning
csharp_using_directive_placement = outside_namespace:warning csharp_using_directive_placement = outside_namespace:warning
# Modifier preferences
csharp_prefer_static_local_function = true:warning csharp_prefer_static_local_function = true:warning
csharp_prefer_simple_using_statement = true:suggestion
########################################## ##########################################
# .NET Formatting Conventions # Unnecessary Code Rules
# https://docs.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/unnecessary-code-rules
########################################## ##########################################
# Organize usings # .NET Unnecessary code rules
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#organize-using-directives [*.{cs,csx,cake,vb,vbx}]
dotnet_code_quality_unused_parameters = all:warning
dotnet_remove_unnecessary_suppression_exclusions = none:warning
# C# Unnecessary code rules
[*.{cs,csx,cake}]
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
dotnet_diagnostic.IDE0058.severity = suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
dotnet_diagnostic.IDE0059.severity = suggestion
##########################################
# Formatting Rules
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules
##########################################
# .NET formatting rules
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#net-formatting-rules
[*.{cs,csx,cake,vb,vbx}]
# Organize using directives
dotnet_sort_system_directives_first = true dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# C# formatting rules
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#c-formatting-rules
[*.{cs,csx,cake}]
# Newline options # Newline options
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options # https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options
csharp_new_line_before_open_brace = all csharp_new_line_before_open_brace = all
@ -231,14 +245,14 @@ csharp_space_around_declaration_statements = false
csharp_space_before_open_square_brackets = false csharp_space_before_open_square_brackets = false
csharp_space_between_empty_square_brackets = false csharp_space_between_empty_square_brackets = false
csharp_space_between_square_brackets = false csharp_space_between_square_brackets = false
# Wrapping options # Wrap options
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options # https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options
csharp_preserve_single_line_statements = false csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true csharp_preserve_single_line_blocks = true
########################################## ##########################################
# .NET Naming Conventions # .NET Naming Rules
# https://docs.microsoft.com/visualstudio/ide/editorconfig-naming-conventions # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/naming-rules
########################################## ##########################################
[*.{cs,csx,cake,vb,vbx}] [*.{cs,csx,cake,vb,vbx}]
@ -261,8 +275,9 @@ dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization = pascal_
dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T
# disallowed_style - Anything that has this style applied is marked as disallowed # disallowed_style - Anything that has this style applied is marked as disallowed
dotnet_naming_style.disallowed_style.capitalization = pascal_case dotnet_naming_style.disallowed_style.capitalization = pascal_case
dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____ # Disabled while we investigate compatibility with VS 16.10
dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____ #dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____
#dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____
# internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file # internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file
dotnet_naming_style.internal_error_style.capitalization = pascal_case dotnet_naming_style.internal_error_style.capitalization = pascal_case
dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____ dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____

2
shared-infrastructure

@ -1 +1 @@
Subproject commit 9b1179f0ebe6a4dfed998252b860fa07fee54363 Subproject commit 462f789c52809728505833d101b9a96022e0fc3b
Loading…
Cancel
Save