chore: codestyle and roslyn analyzers best practices (#171)
This commit is contained in:
Родитель
79c4f549e8
Коммит
0319816fab
|
@ -0,0 +1,450 @@
|
|||
# Version: 4.1.1 (Using https://semver.org/)
|
||||
# Updated: 2022-05-23
|
||||
# See https://github.com/RehanSaeed/EditorConfig/releases for release notes.
|
||||
# See https://github.com/RehanSaeed/EditorConfig for updates to this file.
|
||||
# See http://EditorConfig.org for more information about .editorconfig files.
|
||||
|
||||
##########################################
|
||||
# Common Settings
|
||||
##########################################
|
||||
|
||||
# This file is the top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# All Files
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
##########################################
|
||||
# File Extension Settings
|
||||
##########################################
|
||||
|
||||
# Visual Studio Solution Files
|
||||
[*.sln]
|
||||
indent_style = tab
|
||||
|
||||
# Visual Studio XML Project Files
|
||||
[*.{csproj,vbproj,vcxproj.filters,proj,projitems,shproj}]
|
||||
indent_size = 2
|
||||
|
||||
# XML Configuration Files
|
||||
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}]
|
||||
indent_size = 2
|
||||
|
||||
# JSON Files
|
||||
[*.{json,json5,webmanifest}]
|
||||
indent_size = 2
|
||||
|
||||
# YAML Files
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
# Markdown Files
|
||||
[*.{md,mdx}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
# Web Files
|
||||
[*.{htm,html,js,jsm,ts,tsx,cjs,cts,ctsx,mjs,mts,mtsx,css,sass,scss,less,pcss,svg,vue}]
|
||||
indent_size = 2
|
||||
|
||||
# Batch Files
|
||||
[*.{cmd,bat}]
|
||||
end_of_line = crlf
|
||||
|
||||
# Bash Files
|
||||
[*.sh]
|
||||
end_of_line = lf
|
||||
|
||||
# Makefiles
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
##########################################
|
||||
# Default .NET Code Style Severities
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope
|
||||
##########################################
|
||||
|
||||
[*.{cs,csx,cake,vb,vbx}]
|
||||
# Default Severity for all .NET Code Style rules below
|
||||
dotnet_analyzer_diagnostic.severity = warning
|
||||
|
||||
##########################################
|
||||
# Language Rules
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules
|
||||
##########################################
|
||||
|
||||
# .NET Style Rules
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#net-style-rules
|
||||
[*.{cs,csx,cake,vb,vbx}]
|
||||
# "this." and "Me." qualifiers
|
||||
dotnet_style_qualification_for_field = true:warning
|
||||
dotnet_style_qualification_for_property = true:warning
|
||||
dotnet_style_qualification_for_method = true:warning
|
||||
dotnet_style_qualification_for_event = true:warning
|
||||
# Language keywords instead of framework type names for type references
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
|
||||
dotnet_style_predefined_type_for_member_access = true:warning
|
||||
# Modifier preferences
|
||||
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
|
||||
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
|
||||
# Parentheses preferences
|
||||
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_other_binary_operators = always_for_clarity:warning
|
||||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
|
||||
# Expression-level preferences
|
||||
dotnet_style_object_initializer = true:warning
|
||||
dotnet_style_collection_initializer = true:warning
|
||||
dotnet_style_explicit_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_auto_properties = true:warning
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion
|
||||
dotnet_diagnostic.IDE0045.severity = 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_simplified_interpolation = true:warning
|
||||
dotnet_style_prefer_simplified_boolean_expressions = true:warning
|
||||
# Null-checking preferences
|
||||
dotnet_style_coalesce_expression = true:warning
|
||||
dotnet_style_null_propagation = true:warning
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||
# File header preferences
|
||||
# file_header_template = <copyright file="{fileName}" company="PROJECT-AUTHOR">\n© PROJECT-AUTHOR\n</copyright>
|
||||
# If you use StyleCop, you'll need to disable SA1636: File header copyright text should match.
|
||||
# dotnet_diagnostic.SA1636.severity = none
|
||||
# Undocumented
|
||||
dotnet_style_operator_placement_when_wrapping = end_of_line:warning
|
||||
csharp_style_prefer_null_check_over_type_check = true:warning
|
||||
|
||||
# C# Style Rules
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#c-style-rules
|
||||
[*.{cs,csx,cake}]
|
||||
# 'var' preferences
|
||||
csharp_style_var_for_built_in_types = true:warning
|
||||
csharp_style_var_when_type_is_apparent = true:warning
|
||||
csharp_style_var_elsewhere = true:warning
|
||||
# Expression-bodied members
|
||||
csharp_style_expression_bodied_methods = true:warning
|
||||
csharp_style_expression_bodied_constructors = true:warning
|
||||
csharp_style_expression_bodied_operators = true:warning
|
||||
csharp_style_expression_bodied_properties = true:warning
|
||||
csharp_style_expression_bodied_indexers = true:warning
|
||||
csharp_style_expression_bodied_accessors = true:warning
|
||||
csharp_style_expression_bodied_lambdas = true:warning
|
||||
csharp_style_expression_bodied_local_functions = true:warning
|
||||
# Pattern matching preferences
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:warning
|
||||
csharp_style_prefer_switch_expression = true:warning
|
||||
csharp_style_prefer_pattern_matching = true:warning
|
||||
csharp_style_prefer_not_pattern = true:warning
|
||||
# Expression-level preferences
|
||||
csharp_style_inlined_variable_declaration = 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
|
||||
csharp_style_throw_expression = true:warning
|
||||
csharp_style_conditional_delegate_call = true:warning
|
||||
# Code block preferences
|
||||
csharp_prefer_braces = true:warning
|
||||
csharp_prefer_simple_using_statement = true:suggestion
|
||||
dotnet_diagnostic.IDE0063.severity = suggestion
|
||||
# 'using' directive preferences
|
||||
csharp_using_directive_placement = inside_namespace:warning
|
||||
# Modifier preferences
|
||||
csharp_prefer_static_local_function = true:warning
|
||||
|
||||
##########################################
|
||||
# Unnecessary Code Rules
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/unnecessary-code-rules
|
||||
##########################################
|
||||
|
||||
# .NET Unnecessary code rules
|
||||
[*.{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_separate_import_directive_groups = false
|
||||
# Dotnet namespace options
|
||||
dotnet_style_namespace_match_folder = true:suggestion
|
||||
dotnet_diagnostic.IDE0130.severity = suggestion
|
||||
|
||||
# C# formatting rules
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#c-formatting-rules
|
||||
[*.{cs,csx,cake}]
|
||||
# Newline options
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#new-line-options
|
||||
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 options
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#indentation-options
|
||||
csharp_indent_case_contents = true
|
||||
csharp_indent_switch_labels = true
|
||||
csharp_indent_labels = no_change
|
||||
csharp_indent_block_contents = true
|
||||
csharp_indent_braces = false
|
||||
csharp_indent_case_contents_when_block = false
|
||||
# Spacing options
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#spacing-options
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = true
|
||||
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_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_after_comma = true
|
||||
csharp_space_before_comma = false
|
||||
csharp_space_after_dot = false
|
||||
csharp_space_before_dot = false
|
||||
csharp_space_after_semicolon_in_for_statement = true
|
||||
csharp_space_before_semicolon_in_for_statement = false
|
||||
csharp_space_around_declaration_statements = false
|
||||
csharp_space_before_open_square_brackets = false
|
||||
csharp_space_between_empty_square_brackets = false
|
||||
csharp_space_between_square_brackets = false
|
||||
# Wrap options
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#wrap-options
|
||||
csharp_preserve_single_line_statements = false
|
||||
csharp_preserve_single_line_blocks = true
|
||||
# Namespace options
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#namespace-options
|
||||
csharp_style_namespace_declarations = file_scoped:warning
|
||||
|
||||
##########################################
|
||||
# .NET Naming Rules
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/naming-rules
|
||||
##########################################
|
||||
|
||||
[*.{cs,csx,cake,vb,vbx}]
|
||||
|
||||
##########################################
|
||||
# Styles
|
||||
##########################################
|
||||
|
||||
# camel_case_style - Define the camelCase style
|
||||
dotnet_naming_style.camel_case_style.capitalization = camel_case
|
||||
# pascal_case_style - Define the PascalCase style
|
||||
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||
# first_upper_style - The first character must start with an upper-case character
|
||||
dotnet_naming_style.first_upper_style.capitalization = first_word_upper
|
||||
# prefix_interface_with_i_style - Interfaces must be PascalCase and the first character of an interface must be an 'I'
|
||||
dotnet_naming_style.prefix_interface_with_i_style.capitalization = pascal_case
|
||||
dotnet_naming_style.prefix_interface_with_i_style.required_prefix = I
|
||||
# prefix_type_parameters_with_t_style - Generic Type Parameters must be PascalCase and the first character must be a 'T'
|
||||
dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization = pascal_case
|
||||
dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T
|
||||
# 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.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
|
||||
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_suffix = ____INTERNAL_ERROR____
|
||||
|
||||
##########################################
|
||||
# .NET Design Guideline Field Naming Rules
|
||||
# Naming rules for fields follow the .NET Framework design guidelines
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/index
|
||||
##########################################
|
||||
|
||||
# All public/protected/protected_internal constant fields must be PascalCase
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/field
|
||||
dotnet_naming_symbols.public_protected_constant_fields_group.applicable_accessibilities = public, protected, protected_internal
|
||||
dotnet_naming_symbols.public_protected_constant_fields_group.required_modifiers = const
|
||||
dotnet_naming_symbols.public_protected_constant_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.symbols = public_protected_constant_fields_group
|
||||
dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.style = pascal_case_style
|
||||
dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.severity = warning
|
||||
|
||||
# All public/protected/protected_internal static readonly fields must be PascalCase
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/field
|
||||
dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_accessibilities = public, protected, protected_internal
|
||||
dotnet_naming_symbols.public_protected_static_readonly_fields_group.required_modifiers = static, readonly
|
||||
dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.symbols = public_protected_static_readonly_fields_group
|
||||
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
|
||||
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.severity = warning
|
||||
|
||||
# No other public/protected/protected_internal fields are allowed
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/field
|
||||
dotnet_naming_symbols.other_public_protected_fields_group.applicable_accessibilities = public, protected, protected_internal
|
||||
dotnet_naming_symbols.other_public_protected_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.symbols = other_public_protected_fields_group
|
||||
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.style = disallowed_style
|
||||
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.severity = error
|
||||
|
||||
##########################################
|
||||
# StyleCop Field Naming Rules
|
||||
# Naming rules for fields follow the StyleCop analyzers
|
||||
# This does not override any rules using disallowed_style above
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
|
||||
##########################################
|
||||
|
||||
# All constant fields must be PascalCase
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.required_modifiers = const
|
||||
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.symbols = stylecop_constant_fields_group
|
||||
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style = pascal_case_style
|
||||
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity = warning
|
||||
|
||||
# All static readonly fields must be PascalCase
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
|
||||
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
|
||||
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
|
||||
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.severity = warning
|
||||
|
||||
# No non-private instance fields are allowed
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md
|
||||
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
|
||||
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.symbols = stylecop_fields_must_be_private_group
|
||||
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.style = disallowed_style
|
||||
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.severity = error
|
||||
|
||||
# Private fields must be camelCase
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1306.md
|
||||
dotnet_naming_symbols.stylecop_private_fields_group.applicable_accessibilities = private
|
||||
dotnet_naming_symbols.stylecop_private_fields_group.applicable_kinds = field
|
||||
dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.symbols = stylecop_private_fields_group
|
||||
dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.style = camel_case_style
|
||||
dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.severity = warning
|
||||
|
||||
# Local variables must be camelCase
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1312.md
|
||||
dotnet_naming_symbols.stylecop_local_fields_group.applicable_accessibilities = local
|
||||
dotnet_naming_symbols.stylecop_local_fields_group.applicable_kinds = local
|
||||
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.symbols = stylecop_local_fields_group
|
||||
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.style = camel_case_style
|
||||
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.severity = silent
|
||||
|
||||
# This rule should never fire. However, it's included for at least two purposes:
|
||||
# First, it helps to understand, reason about, and root-case certain types of issues, such as bugs in .editorconfig parsers.
|
||||
# Second, it helps to raise immediate awareness if a new field type is added (as occurred recently in C#).
|
||||
dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_accessibilities = *
|
||||
dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_kinds = field
|
||||
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.symbols = sanity_check_uncovered_field_case_group
|
||||
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.style = internal_error_style
|
||||
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.severity = error
|
||||
|
||||
|
||||
##########################################
|
||||
# Other Naming Rules
|
||||
##########################################
|
||||
|
||||
# All of the following must be PascalCase:
|
||||
# - Namespaces
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-namespaces
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1300.md
|
||||
# - Classes and Enumerations
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1300.md
|
||||
# - Delegates
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#names-of-common-types
|
||||
# - Constructors, Properties, Events, Methods
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-type-members
|
||||
dotnet_naming_symbols.element_group.applicable_kinds = namespace, class, enum, struct, delegate, event, method, property
|
||||
dotnet_naming_rule.element_rule.symbols = element_group
|
||||
dotnet_naming_rule.element_rule.style = pascal_case_style
|
||||
dotnet_naming_rule.element_rule.severity = warning
|
||||
|
||||
# Interfaces use PascalCase and are prefixed with uppercase 'I'
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces
|
||||
dotnet_naming_symbols.interface_group.applicable_kinds = interface
|
||||
dotnet_naming_rule.interface_rule.symbols = interface_group
|
||||
dotnet_naming_rule.interface_rule.style = prefix_interface_with_i_style
|
||||
dotnet_naming_rule.interface_rule.severity = warning
|
||||
|
||||
# Generics Type Parameters use PascalCase and are prefixed with uppercase 'T'
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces
|
||||
dotnet_naming_symbols.type_parameter_group.applicable_kinds = type_parameter
|
||||
dotnet_naming_rule.type_parameter_rule.symbols = type_parameter_group
|
||||
dotnet_naming_rule.type_parameter_rule.style = prefix_type_parameters_with_t_style
|
||||
dotnet_naming_rule.type_parameter_rule.severity = warning
|
||||
|
||||
# Function parameters use camelCase
|
||||
# https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-parameters
|
||||
dotnet_naming_symbols.parameters_group.applicable_kinds = parameter
|
||||
dotnet_naming_rule.parameters_rule.symbols = parameters_group
|
||||
dotnet_naming_rule.parameters_rule.style = camel_case_style
|
||||
dotnet_naming_rule.parameters_rule.severity = warning
|
||||
|
||||
##########################################
|
||||
# License
|
||||
##########################################
|
||||
# The following applies as to the .editorconfig file ONLY, and is
|
||||
# included below for reference, per the requirements of the license
|
||||
# corresponding to this .editorconfig file.
|
||||
# See: https://github.com/RehanSaeed/EditorConfig
|
||||
#
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2017-2019 Muhammad Rehan Saeed
|
||||
# Copyright (c) 2019 Henry Gabryjelski
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any
|
||||
# person obtaining a copy of this software and associated
|
||||
# documentation files (the "Software"), to deal in the
|
||||
# Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute,
|
||||
# sublicense, and/or sell copies of the Software, and to permit
|
||||
# persons to whom the Software is furnished to do so, subject
|
||||
# to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
##########################################
|
|
@ -1,40 +1,33 @@
|
|||
<Project>
|
||||
|
||||
<PropertyGroup Label="Build">
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<TreatWarningsAsErrors Condition="'$(OFFICIAL_BUILD)' == 'True'">true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Build">
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||
<AnalysisLevel>latest</AnalysisLevel>
|
||||
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<NoWarn>$(NoWarn);CS1591;NU1608,NU5119;SA1600</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Package">
|
||||
<Authors>Microsoft</Authors>
|
||||
<Company>Microsoft</Company>
|
||||
<Copyright>Copyright © Microsoft Corporation. All rights reserved.</Copyright>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/microsoft/component-detection</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/microsoft/component-detection.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageReleaseNotes>https://github.com/microsoft/component-detection/releases</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Package">
|
||||
<Authors>Microsoft</Authors>
|
||||
<Company>Microsoft</Company>
|
||||
<Copyright>Copyright © Microsoft Corporation. All rights reserved.</Copyright>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/microsoft/component-detection</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/microsoft/component-detection.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageReleaseNotes>https://github.com/microsoft/component-detection/releases</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" PrivateAssets="all"/>
|
||||
<PackageReference Include="MinVer" PrivateAssets="all"/>
|
||||
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="all"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" PrivateAssets="all"/>
|
||||
<PackageReference Include="MinVer" PrivateAssets="all"/>
|
||||
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="all"/>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)analyzers.ruleset</CodeAnalysisRuleSet>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<NoWarn>NU1608,NU5119</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(OFFICIAL_BUILD)'=='True'">
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="MinVer" PrivateAssets="all"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
<PackageVersion Include="Docker.DotNet" Version="3.125.5"/>
|
||||
<PackageVersion Include="FluentAssertions" Version="6.7.0"/>
|
||||
<PackageVersion Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9"/>
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0"/>
|
||||
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="3.1.26" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.2.0"/>
|
||||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1"/>
|
||||
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.2.32"/>
|
||||
<PackageVersion Include="DotNet.Glob" Version="2.1.4"/>
|
||||
<PackageVersion Include="MinVer" Version="4.1.0"/>
|
||||
<PackageVersion Include="Moq" Version="4.18.1"/>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<PackageVersion Include="packageurl-dotnet" Version="1.0.0"/>
|
||||
<PackageVersion Include="Polly" Version="7.2.3"/>
|
||||
<PackageVersion Include="Semver" Version="2.0.6"/>
|
||||
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118"/>
|
||||
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.435"/>
|
||||
<PackageVersion Include="System.Composition.AttributedModel" Version="1.4.1"/>
|
||||
<PackageVersion Include="System.Composition.Convention" Version="1.4.1"/>
|
||||
<PackageVersion Include="System.Composition.Hosting" Version="1.4.1"/>
|
||||
|
|
|
@ -1,503 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="Style and code analisis rules" Description="Analysis rules for StyleCop and FxCop analizers." ToolsVersion="14.0">
|
||||
<Rules AnalyzerId="AsyncUsageAnalyzers" RuleNamespace="AsyncUsageAnalyzers">
|
||||
<Rule Id="UseConfigureAwait" Action="Warning" />
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
|
||||
<Rule Id="CA2104" Action="None" />
|
||||
<Rule Id="CA2210" Action="None" />
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.SpecialRules">
|
||||
<Rule Id="SA0001" Action="None" /> <!-- XML comment analysis disabled -->
|
||||
<Rule Id="SA0002" Action="None" /> <!-- Invalid settings file -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.SpacingRules">
|
||||
<Rule Id="SA1000" Action="Warning" /> <!-- Keywords should be spaced correctly -->
|
||||
<Rule Id="SA1001" Action="Warning" /> <!-- Commas should be spaced correctly -->
|
||||
<Rule Id="SA1002" Action="Warning" /> <!-- Semicolons should be spaced correctly -->
|
||||
<Rule Id="SA1003" Action="Warning" /> <!-- Symbols should be spaced correctly -->
|
||||
<Rule Id="SA1004" Action="Warning" /> <!-- Documentation lines should begin with single space -->
|
||||
<Rule Id="SA1005" Action="None" /> <!-- Single line comments should begin with single space -->
|
||||
<Rule Id="SA1006" Action="None" /> <!-- Preprocessor keywords should not be preceded by space -->
|
||||
<Rule Id="SA1007" Action="Warning" /> <!-- Operator keyword should be followed by space -->
|
||||
<Rule Id="SA1008" Action="Warning" /> <!-- Opening parenthesis should be spaced correctly -->
|
||||
<Rule Id="SA1009" Action="Warning" /> <!-- Closing parenthesis should be spaced correctly -->
|
||||
<Rule Id="SA1010" Action="Warning" /> <!-- Opening square brackets should be spaced correctly -->
|
||||
<Rule Id="SA1011" Action="Warning" /> <!-- Closing square brackets should be spaced correctly -->
|
||||
<Rule Id="SA1012" Action="Warning" /> <!-- Opening braces should be spaced correctly -->
|
||||
<Rule Id="SA1013" Action="Warning" /> <!-- Closing braces should be spaced correctly -->
|
||||
<Rule Id="SA1014" Action="Warning" /> <!-- Opening generic brackets should be spaced correctly -->
|
||||
<Rule Id="SA1015" Action="Warning" /> <!-- Closing generic brackets should be spaced correctly -->
|
||||
<Rule Id="SA1016" Action="Warning" /> <!-- Opening attribute brackets should be spaced correctly -->
|
||||
<Rule Id="SA1017" Action="Warning" /> <!-- Closing attribute brackets should be spaced correctly -->
|
||||
<Rule Id="SA1018" Action="Warning" /> <!-- Nullable type symbols should be spaced correctly -->
|
||||
<Rule Id="SA1019" Action="Warning" /> <!-- Member access symbols should be spaced correctly -->
|
||||
<Rule Id="SA1020" Action="Warning" /> <!-- Increment decrement symbols should be spaced correctly -->
|
||||
<Rule Id="SA1021" Action="Warning" /> <!-- Negative signs should be spaced correctly -->
|
||||
<Rule Id="SA1022" Action="Warning" /> <!-- Positive signs should be spaced correctly -->
|
||||
<Rule Id="SA1023" Action="Warning" /> <!-- Dereference and access of symbols should be spaced correctly -->
|
||||
<Rule Id="SA1024" Action="Warning" /> <!-- Colons should be spaced correctly -->
|
||||
<Rule Id="SA1025" Action="Warning" /> <!-- Code should not contain multiple whitespace in a row -->
|
||||
<Rule Id="SA1026" Action="Warning" /> <!-- Code should not contain space after new or stackalloc keyword in implicitly typed array allocation -->
|
||||
<Rule Id="SA1027" Action="Warning" /> <!-- Use tabs correctly -->
|
||||
<Rule Id="SA1028" Action="None" /> <!-- Code should not contain trailing whitespace -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.ReadabilityRules">
|
||||
<Rule Id="SA1100" Action="Warning" /> <!-- Do not prefix calls with base unless local implementation exists -->
|
||||
<Rule Id="SA1101" Action="None" /> <!-- Prefix local calls with this -->
|
||||
<Rule Id="SA1102" Action="None" /> <!-- Query clause should follow previous clause -->
|
||||
<Rule Id="SA1103" Action="None" /> <!-- Query clauses should be on separate lines or all on one line -->
|
||||
<Rule Id="SA1104" Action="None" /> <!-- Query clause should begin on new line when previous clause spans multiple lines -->
|
||||
<Rule Id="SA1105" Action="None" /> <!-- Query clauses spanning multiple lines should begin on own line -->
|
||||
<Rule Id="SA1106" Action="Warning" /> <!-- Code should not contain empty statements -->
|
||||
<Rule Id="SA1107" Action="Warning" /> <!-- Code should not contain multiple statements on one line -->
|
||||
<Rule Id="SA1108" Action="None" /> <!-- Block statements should not contain embedded comments -->
|
||||
<Rule Id="SA1109" Action="None" /> <!-- Block statements should not contain embedded regions -->
|
||||
<Rule Id="SA1110" Action="Warning" /> <!-- Opening parenthesis or bracket should be on declaration line -->
|
||||
<Rule Id="SA1111" Action="Warning" /> <!-- Closing parenthesis should be on line of last parameter -->
|
||||
<Rule Id="SA1112" Action="None" /> <!-- Closing parenthesis should be on line of opening parenthesis -->
|
||||
<Rule Id="SA1113" Action="Warning" /> <!-- Comma should be on the same line as previous parameter -->
|
||||
<Rule Id="SA1114" Action="None" /> <!-- Parameter list should follow declaration -->
|
||||
<Rule Id="SA1115" Action="None" /> <!-- Parameter should follow comma -->
|
||||
<Rule Id="SA1116" Action="Warning" /> <!-- Split parameters should start on line after declaration -->
|
||||
<Rule Id="SA1117" Action="None" /> <!-- Parameters should be on same line or separate lines -->
|
||||
<Rule Id="SA1118" Action="None" /> <!-- Parameter should not span multiple lines -->
|
||||
<Rule Id="SA1120" Action="Warning" /> <!-- Comments should contain text -->
|
||||
<Rule Id="SA1121" Action="Warning" /> <!-- Use built-in type alias -->
|
||||
<Rule Id="SA1122" Action="Warning" /> <!-- Use string.Empty for empty strings -->
|
||||
<Rule Id="SA1123" Action="Warning" /> <!-- Do not place regions within elements -->
|
||||
<Rule Id="SA1124" Action="Warning" /> <!-- Do not use regions -->
|
||||
<Rule Id="SA1125" Action="None" /> <!-- Use shorthand for nullable types -->
|
||||
<Rule Id="SA1126" Action="None" /> <!-- Prefix calls correctly -->
|
||||
<Rule Id="SA1127" Action="Warning" /> <!-- Generic type constraints should be on their own line -->
|
||||
<Rule Id="SA1128" Action="Warning" /> <!-- Put constructor initializers on their own line -->
|
||||
<Rule Id="SA1129" Action="None" /> <!-- Do not use default value type constructor -->
|
||||
<Rule Id="SA1130" Action="Warning" /> <!-- Use lambda syntax -->
|
||||
<Rule Id="SA1131" Action="Warning" /> <!-- Use readable conditions -->
|
||||
<Rule Id="SA1132" Action="Warning" /> <!-- Do not combine fields -->
|
||||
<Rule Id="SA1133" Action="Warning" /> <!-- Do not combine attributes -->
|
||||
<Rule Id="SA1134" Action="Warning" /> <!-- Attributes should not share line -->
|
||||
<Rule Id="SA1135" Action="Warning" /> <!-- Using directives should be qualified -->
|
||||
<Rule Id="SA1136" Action="Warning" /> <!-- Enum values should be on separate lines -->
|
||||
<Rule Id="SA1137" Action="Warning" /> <!-- Elements should have the same indentation -->
|
||||
<Rule Id="SA1139" Action="None" /> <!-- Use literal suffix notation instead of casting -->
|
||||
<Rule Id="SX1101" Action="Warning" /> <!-- Do not prefix local calls with 'this.' -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.OrderingRules">
|
||||
<Rule Id="SA1200" Action="None" /> <!-- Using directives should be placed correctly -->
|
||||
<Rule Id="SA1201" Action="None" /> <!-- Elements should appear in the correct order -->
|
||||
<Rule Id="SA1202" Action="None" /> <!-- Elements should be ordered by access -->
|
||||
<Rule Id="SA1203" Action="None" /> <!-- Constants should appear before fields -->
|
||||
<Rule Id="SA1204" Action="None" /> <!-- Static elements should appear before instance elements -->
|
||||
<Rule Id="SA1205" Action="None" /> <!-- Partial elements should declare access -->
|
||||
<Rule Id="SA1206" Action="None" /> <!-- Declaration keywords should follow order -->
|
||||
<Rule Id="SA1207" Action="None" /> <!-- Protected should come before internal -->
|
||||
<Rule Id="SA1208" Action="None" /> <!-- System using directives should be placed before other using directives -->
|
||||
<Rule Id="SA1209" Action="Warning" /> <!-- Using alias directives should be placed after other using directives -->
|
||||
<Rule Id="SA1210" Action="None" /> <!-- Using directives should be ordered alphabetically by namespace -->
|
||||
<Rule Id="SA1211" Action="Warning" /> <!-- Using alias directives should be ordered alphabetically by alias name -->
|
||||
<Rule Id="SA1212" Action="None" /> <!-- Property accessors should follow order -->
|
||||
<Rule Id="SA1213" Action="None" /> <!-- Event accessors should follow order -->
|
||||
<Rule Id="SA1214" Action="None" /> <!-- Readonly fields should appear before non-readonly fields -->
|
||||
<Rule Id="SA1216" Action="None" /> <!-- Using static directives should be placed at the correct location -->
|
||||
<Rule Id="SA1217" Action="Warning" /> <!-- Using static directives should be ordered alphabetically -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.NamingRules">
|
||||
<Rule Id="SA1300" Action="Warning" /> <!-- Element should begin with upper-case letter -->
|
||||
<Rule Id="SA1301" Action="None" /> <!-- Element should begin with lower-case letter -->
|
||||
<Rule Id="SA1302" Action="Warning" /> <!-- Interface names should begin with I -->
|
||||
<Rule Id="SA1303" Action="Warning" /> <!-- Const field names should begin with upper-case letter -->
|
||||
<Rule Id="SA1304" Action="Warning" /> <!-- Non-private readonly fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1305" Action="None" /> <!-- Field names should not use Hungarian notation -->
|
||||
<Rule Id="SA1306" Action="Warning" /> <!-- Field names should begin with lower-case letter -->
|
||||
<Rule Id="SA1307" Action="Warning" /> <!-- Accessible fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1308" Action="Warning" /> <!-- Variable names should not be prefixed -->
|
||||
<Rule Id="SA1309" Action="Warning" /> <!-- Field names should not begin with underscore -->
|
||||
<Rule Id="SA1310" Action="Warning" /> <!-- Field names should not contain underscore -->
|
||||
<Rule Id="SA1311" Action="Warning" /> <!-- Static readonly fields should begin with upper-case letter -->
|
||||
<Rule Id="SA1312" Action="Warning" /> <!-- Variable names should begin with lower-case letter -->
|
||||
<Rule Id="SA1313" Action="Warning" /> <!-- Parameter names should begin with lower-case letter -->
|
||||
<Rule Id="SA1314" Action="Warning" /> <!-- Type parameter names should begin with T -->
|
||||
<Rule Id="SX1309" Action="None" /> <!-- Field names should begin with underscore -->
|
||||
<Rule Id="SX1309S" Action="None" /> <!-- Static field names should begin with underscore -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.MaintainabilityRules">
|
||||
<Rule Id="SA1119" Action="Warning" /> <!-- Statement should not use unnecessary parenthesis -->
|
||||
<Rule Id="SA1400" Action="Warning" /> <!-- Access modifier should be declared -->
|
||||
<Rule Id="SA1401" Action="None" /> <!-- Fields should be private -->
|
||||
<Rule Id="SA1402" Action="Warning" /> <!-- File may only contain a single type -->
|
||||
<Rule Id="SA1403" Action="None" /> <!-- File may only contain a single namespace -->
|
||||
<Rule Id="SA1404" Action="Warning" /> <!-- Code analysis suppression should have justification -->
|
||||
<Rule Id="SA1405" Action="None" /> <!-- Debug.Assert should provide message text -->
|
||||
<Rule Id="SA1406" Action="None" /> <!-- Debug.Fail should provide message text -->
|
||||
<Rule Id="SA1407" Action="Warning" /> <!-- Arithmetic expressions should declare precedence -->
|
||||
<Rule Id="SA1408" Action="Warning" /> <!-- Conditional expressions should declare precedence -->
|
||||
<Rule Id="SA1409" Action="Warning" /> <!-- Remove unnecessary code -->
|
||||
<Rule Id="SA1410" Action="Warning" /> <!-- Remove delegate parenthesis when possible -->
|
||||
<Rule Id="SA1411" Action="Warning" /> <!-- Attribute constructor should not use unnecessary parenthesis -->
|
||||
<Rule Id="SA1412" Action="None" /> <!-- Store files as UTF-8 with byte order mark -->
|
||||
<Rule Id="SA1413" Action="Warning" /> <!-- Use trailing comma in multi-line initializers -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.LayoutRules">
|
||||
<Rule Id="SA1500" Action="None" /> <!-- Braces for multi-line statements should not share line -->
|
||||
<Rule Id="SA1501" Action="Warning" /> <!-- Statement should not be on a single line -->
|
||||
<Rule Id="SA1502" Action="None" /> <!-- Element should not be on a single line -->
|
||||
<Rule Id="SA1503" Action="Warning" /> <!-- Braces should not be omitted -->
|
||||
<Rule Id="SA1504" Action="Warning" /> <!-- All accessors should be single-line or multi-line -->
|
||||
<Rule Id="SA1505" Action="Warning" /> <!-- Opening braces should not be followed by blank line -->
|
||||
<Rule Id="SA1506" Action="Warning" /> <!-- Element documentation headers should not be followed by blank line -->
|
||||
<Rule Id="SA1507" Action="Warning" /> <!-- Code should not contain multiple blank lines in a row -->
|
||||
<Rule Id="SA1508" Action="Warning" /> <!-- Closing braces should not be preceded by blank line -->
|
||||
<Rule Id="SA1509" Action="Warning" /> <!-- Opening braces should not be preceded by blank line -->
|
||||
<Rule Id="SA1510" Action="Warning" /> <!-- Chained statement blocks should not be preceded by blank line -->
|
||||
<Rule Id="SA1511" Action="Warning" /> <!-- While-do footer should not be preceded by blank line -->
|
||||
<Rule Id="SA1512" Action="Warning" /> <!-- Single-line comments should not be followed by blank line -->
|
||||
<Rule Id="SA1513" Action="Warning" /> <!-- Closing brace should be followed by blank line -->
|
||||
<Rule Id="SA1514" Action="Warning" /> <!-- Element documentation header should be preceded by blank line -->
|
||||
<Rule Id="SA1515" Action="Warning" /> <!-- Single-line comment should be preceded by blank line -->
|
||||
<Rule Id="SA1516" Action="Warning" /> <!-- Elements should be separated by blank line -->
|
||||
<Rule Id="SA1517" Action="Warning" /> <!-- Code should not contain blank lines at start of file -->
|
||||
<Rule Id="SA1518" Action="Warning" /> <!-- Use line endings correctly at end of file -->
|
||||
<Rule Id="SA1519" Action="Warning" /> <!-- Braces should not be omitted from multi-line child statement -->
|
||||
<Rule Id="SA1520" Action="Warning" /> <!-- Use braces consistently -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.DocumentationRules">
|
||||
<Rule Id="SA1600" Action="None" /> <!-- Elements should be documented -->
|
||||
<Rule Id="SA1601" Action="None" /> <!-- Partial elements should be documented -->
|
||||
<Rule Id="SA1602" Action="None" /> <!-- Enumeration items should be documented -->
|
||||
<Rule Id="SA1603" Action="None" /> <!-- Documentation should contain valid XML -->
|
||||
<Rule Id="SA1604" Action="None" /> <!-- Element documentation should have summary -->
|
||||
<Rule Id="SA1605" Action="None" /> <!-- Partial element documentation should have summary -->
|
||||
<Rule Id="SA1606" Action="None" /> <!-- Element documentation should have summary text -->
|
||||
<Rule Id="SA1607" Action="None" /> <!-- Partial element documentation should have summary text -->
|
||||
<Rule Id="SA1608" Action="None" /> <!-- Element documentation should not have default summary -->
|
||||
<Rule Id="SA1609" Action="None" /> <!-- Property documentation should have value -->
|
||||
<Rule Id="SA1610" Action="None" /> <!-- Property documentation should have value text -->
|
||||
<Rule Id="SA1611" Action="None" /> <!-- Element parameters should be documented -->
|
||||
<Rule Id="SA1612" Action="None" /> <!-- Element parameter documentation should match element parameters -->
|
||||
<Rule Id="SA1613" Action="None" /> <!-- Element parameter documentation should declare parameter name -->
|
||||
<Rule Id="SA1614" Action="None" /> <!-- Element parameter documentation should have text -->
|
||||
<Rule Id="SA1615" Action="None" /> <!-- Element return value should be documented -->
|
||||
<Rule Id="SA1616" Action="None" /> <!-- Element return value documentation should have text -->
|
||||
<Rule Id="SA1617" Action="None" /> <!-- Void return value should not be documented -->
|
||||
<Rule Id="SA1618" Action="None" /> <!-- Generic type parameters should be documented -->
|
||||
<Rule Id="SA1619" Action="None" /> <!-- Generic type parameters should be documented partial class -->
|
||||
<Rule Id="SA1620" Action="None" /> <!-- Generic type parameter documentation should match type parameters -->
|
||||
<Rule Id="SA1621" Action="None" /> <!-- Generic type parameter documentation should declare parameter name -->
|
||||
<Rule Id="SA1622" Action="None" /> <!-- Generic type parameter documentation should have text -->
|
||||
<Rule Id="SA1623" Action="Warning" /> <!-- Property summary documentation should match accessors -->
|
||||
<Rule Id="SA1624" Action="None" /> <!-- Property summary documentation should omit accessor with restricted access -->
|
||||
<Rule Id="SA1625" Action="None" /> <!-- Element documentation should not be copied and pasted -->
|
||||
<Rule Id="SA1626" Action="None" /> <!-- Single-line comments should not use documentation style slashes -->
|
||||
<Rule Id="SA1627" Action="None" /> <!-- Documentation text should not be empty -->
|
||||
<Rule Id="SA1628" Action="Warning" /> <!-- Documentation text should begin with a capital letter -->
|
||||
<Rule Id="SA1629" Action="Warning" /> <!-- Documentation text should end with a period -->
|
||||
<Rule Id="SA1630" Action="None" /> <!-- Documentation text should contain whitespace -->
|
||||
<Rule Id="SA1631" Action="None" /> <!-- Documentation should meet character percentage -->
|
||||
<Rule Id="SA1632" Action="None" /> <!-- Documentation text should meet minimum character length -->
|
||||
<Rule Id="SA1633" Action="None" /> <!-- File should have header -->
|
||||
<Rule Id="SA1634" Action="None" /> <!-- File header should show copyright -->
|
||||
<Rule Id="SA1635" Action="None" /> <!-- File header should have copyright text -->
|
||||
<Rule Id="SA1636" Action="None" /> <!-- File header copyright text should match -->
|
||||
<Rule Id="SA1637" Action="None" /> <!-- File header should contain file name -->
|
||||
<Rule Id="SA1638" Action="None" /> <!-- File header file name documentation should match file name -->
|
||||
<Rule Id="SA1639" Action="None" /> <!-- File header should have summary -->
|
||||
<Rule Id="SA1640" Action="None" /> <!-- File header should have valid company text -->
|
||||
<Rule Id="SA1641" Action="None" /> <!-- File header company name text should match -->
|
||||
<Rule Id="SA1642" Action="None" /> <!-- Constructor summary documentation should begin with standard text -->
|
||||
<Rule Id="SA1643" Action="None" /> <!-- Destructor summary documentation should begin with standard text -->
|
||||
<Rule Id="SA1644" Action="None" /> <!-- Documentation headers should not contain blank lines -->
|
||||
<Rule Id="SA1645" Action="None" /> <!-- Included documentation file does not exist -->
|
||||
<Rule Id="SA1646" Action="None" /> <!-- Included documentation XPath does not exist -->
|
||||
<Rule Id="SA1647" Action="None" /> <!-- Include node does not contain valid file and path -->
|
||||
<Rule Id="SA1648" Action="None" /> <!-- Inheritdoc should be used with inheriting class -->
|
||||
<Rule Id="SA1649" Action="Warning" /> <!-- File name should match first type name -->
|
||||
<Rule Id="SA1650" Action="None" /> <!-- Element documentation should be spelled correctly -->
|
||||
<Rule Id="SA1651" Action="Warning" /> <!-- Do not use placeholder elements -->
|
||||
<Rule Id="SA1652" Action="None" /> <!-- Do not use placeholder elements -->
|
||||
<Rule Id="CS1591" Action="None" /> <!-- Publicly visible type or member should have XML comments -->
|
||||
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.CodeAnalysis.VersionCheckAnalyzer" RuleNamespace="Microsoft.CodeAnalysis.VersionCheckAnalyzer">
|
||||
<Rule Id="CA9999" Action="None" /> <!-- Analyzer version mismatch -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
|
||||
<Rule Id="CA1000" Action="None" /> <!-- Do not declare static members on generic types -->
|
||||
<Rule Id="CA1002" Action="None" /> <!-- Do not expose generic lists -->
|
||||
<Rule Id="CA1003" Action="None" /> <!-- Use generic event handler instances -->
|
||||
<Rule Id="CA1005" Action="None" /> <!-- Avoid excessive parameters on generic types -->
|
||||
<Rule Id="CA1008" Action="None" /> <!-- Enums should have zero value -->
|
||||
<Rule Id="CA1010" Action="None" /> <!-- Generic interface should also be implemented -->
|
||||
<Rule Id="CA1012" Action="None" /> <!-- Abstract types should not have public constructors -->
|
||||
<Rule Id="CA1014" Action="None" /> <!-- Mark assemblies with CLSCompliant -->
|
||||
<Rule Id="CA1016" Action="None" /> <!-- Mark assemblies with assembly version -->
|
||||
<Rule Id="CA1017" Action="None" /> <!-- Mark assemblies with ComVisible -->
|
||||
<Rule Id="CA1018" Action="None" /> <!-- Mark attributes with AttributeUsageAttribute -->
|
||||
<Rule Id="CA1021" Action="None" /> <!-- Avoid out parameters -->
|
||||
<Rule Id="CA1024" Action="None" /> <!-- Use properties where appropriate -->
|
||||
<Rule Id="CA1027" Action="None" /> <!-- Mark enums with FlagsAttribute -->
|
||||
<Rule Id="CA1028" Action="None" /> <!-- Enum Storage should be Int32 -->
|
||||
<Rule Id="CA1030" Action="None" /> <!-- Use events where appropriate -->
|
||||
<Rule Id="CA1031" Action="None" /> <!-- Do not catch general exception types -->
|
||||
<Rule Id="CA1033" Action="None" /> <!-- Interface methods should be callable by child types -->
|
||||
<Rule Id="CA1034" Action="None" /> <!-- Nested types should not be visible -->
|
||||
<Rule Id="CA1036" Action="None" /> <!-- Override methods on comparable types -->
|
||||
<Rule Id="CA1040" Action="None" /> <!-- Avoid empty interfaces -->
|
||||
<Rule Id="CA1041" Action="None" /> <!-- Provide ObsoleteAttribute message -->
|
||||
<Rule Id="CA1043" Action="None" /> <!-- Use Integral Or String Argument For Indexers -->
|
||||
<Rule Id="CA1044" Action="None" /> <!-- Properties should not be write only -->
|
||||
<Rule Id="CA1045" Action="None" /> <!-- Do not pass types by reference -->
|
||||
<Rule Id="CA1046" Action="None" /> <!-- Do not overload equality operator on reference types -->
|
||||
<Rule Id="CA1047" Action="None" /> <!-- Do not declare protected member in sealed type -->
|
||||
<Rule Id="CA1050" Action="None" /> <!-- Declare types in namespaces -->
|
||||
<Rule Id="CA1051" Action="None" /> <!-- Do not declare visible instance fields -->
|
||||
<Rule Id="CA1052" Action="None" /> <!-- Static holder types should be Static or NotInheritable -->
|
||||
<Rule Id="CA1054" Action="None" /> <!-- URI-like parameters should not be strings -->
|
||||
<Rule Id="CA1055" Action="None" /> <!-- URI-like return values should not be strings -->
|
||||
<Rule Id="CA1056" Action="None" /> <!-- URI-like properties should not be strings -->
|
||||
<Rule Id="CA1060" Action="None" /> <!-- Move pinvokes to native methods class -->
|
||||
<Rule Id="CA1061" Action="None" /> <!-- Do not hide base class methods -->
|
||||
<Rule Id="CA1062" Action="None" /> <!-- Validate arguments of public methods -->
|
||||
<Rule Id="CA1063" Action="None" /> <!-- Implement IDisposable Correctly -->
|
||||
<Rule Id="CA1064" Action="None" /> <!-- Exceptions should be public -->
|
||||
<Rule Id="CA1066" Action="None" /> <!-- Implement IEquatable when overriding Object.Equals -->
|
||||
<Rule Id="CA1067" Action="None" /> <!-- Override Object.Equals(object) when implementing IEquatable<T> -->
|
||||
<Rule Id="CA1068" Action="None" /> <!-- CancellationToken parameters must come last -->
|
||||
<Rule Id="CA1069" Action="None" /> <!-- Enums values should not be duplicated -->
|
||||
<Rule Id="CA1070" Action="None" /> <!-- Do not declare event fields as virtual -->
|
||||
<Rule Id="CA1501" Action="None" /> <!-- Avoid excessive inheritance -->
|
||||
<Rule Id="CA1502" Action="None" /> <!-- Avoid excessive complexity -->
|
||||
<Rule Id="CA1505" Action="None" /> <!-- Avoid unmaintainable code -->
|
||||
<Rule Id="CA1506" Action="None" /> <!-- Avoid excessive class coupling -->
|
||||
<Rule Id="CA1508" Action="None" /> <!-- Avoid dead conditional code -->
|
||||
<Rule Id="CA1509" Action="None" /> <!-- Invalid entry in code metrics rule specification file -->
|
||||
<Rule Id="CA1700" Action="None" /> <!-- Do not name enum values 'Reserved' -->
|
||||
<Rule Id="CA1707" Action="None" /> <!-- Identifiers should not contain underscores -->
|
||||
<Rule Id="CA1708" Action="None" /> <!-- Identifiers should differ by more than case -->
|
||||
<Rule Id="CA1710" Action="None" /> <!-- Identifiers should have correct suffix -->
|
||||
<Rule Id="CA1711" Action="None" /> <!-- Identifiers should not have incorrect suffix -->
|
||||
<Rule Id="CA1712" Action="None" /> <!-- Do not prefix enum values with type name -->
|
||||
<Rule Id="CA1713" Action="None" /> <!-- Events should not have 'Before' or 'After' prefix -->
|
||||
<Rule Id="CA1714" Action="None" /> <!-- Flags enums should have plural names -->
|
||||
<Rule Id="CA1715" Action="None" /> <!-- Identifiers should have correct prefix -->
|
||||
<Rule Id="CA1716" Action="None" /> <!-- Identifiers should not match keywords -->
|
||||
<Rule Id="CA1717" Action="None" /> <!-- Only FlagsAttribute enums should have plural names -->
|
||||
<Rule Id="CA1720" Action="None" /> <!-- Identifier contains type name -->
|
||||
<Rule Id="CA1721" Action="None" /> <!-- Property names should not match get methods -->
|
||||
<Rule Id="CA1724" Action="None" /> <!-- Type names should not match namespaces -->
|
||||
<Rule Id="CA1725" Action="None" /> <!-- Parameter names should match base declaration -->
|
||||
<Rule Id="CA1801" Action="None" /> <!-- Review unused parameters -->
|
||||
<Rule Id="CA1802" Action="None" /> <!-- Use literals where appropriate -->
|
||||
<Rule Id="CA1805" Action="None" /> <!-- Do not initialize unnecessarily -->
|
||||
<Rule Id="CA1806" Action="None" /> <!-- Do not ignore method results -->
|
||||
<Rule Id="CA1814" Action="None" /> <!-- Prefer jagged arrays over multidimensional -->
|
||||
<Rule Id="CA1815" Action="None" /> <!-- Override equals and operator equals on value types -->
|
||||
<Rule Id="CA1819" Action="None" /> <!-- Properties should not return arrays -->
|
||||
<Rule Id="CA1821" Action="None" /> <!-- Remove empty Finalizers -->
|
||||
<Rule Id="CA1822" Action="None" /> <!-- Mark members as static -->
|
||||
<Rule Id="CA1823" Action="None" /> <!-- Avoid unused private fields -->
|
||||
<Rule Id="CA2007" Action="None" /> <!-- Consider calling ConfigureAwait on the awaited task -->
|
||||
<Rule Id="CA2011" Action="None" /> <!-- Avoid infinite recursion -->
|
||||
<Rule Id="CA2109" Action="None" /> <!-- Review visible event handlers -->
|
||||
<Rule Id="CA2119" Action="None" /> <!-- Seal methods that satisfy private interfaces -->
|
||||
<Rule Id="CA2211" Action="None" /> <!-- Non-constant fields should not be visible -->
|
||||
<Rule Id="CA2214" Action="None" /> <!-- Do not call overridable methods in constructors -->
|
||||
<Rule Id="CA2217" Action="None" /> <!-- Do not mark enums with FlagsAttribute -->
|
||||
<Rule Id="CA2219" Action="None" /> <!-- Do not raise exceptions in finally clauses -->
|
||||
<Rule Id="CA2225" Action="None" /> <!-- Operator overloads have named alternates -->
|
||||
<Rule Id="CA2226" Action="None" /> <!-- Operators should have symmetrical overloads -->
|
||||
<Rule Id="CA2227" Action="None" /> <!-- Collection properties should be read only -->
|
||||
<Rule Id="CA2231" Action="None" /> <!-- Overload operator equals on overriding value type Equals -->
|
||||
<Rule Id="CA2244" Action="None" /> <!-- Do not duplicate indexed element initializations -->
|
||||
<Rule Id="CA2245" Action="None" /> <!-- Do not assign a property to itself -->
|
||||
<Rule Id="CA2246" Action="None" /> <!-- Assigning symbol and its member in the same statement -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.CodeQuality.CSharp.Analyzers" RuleNamespace="Microsoft.CodeQuality.CSharp.Analyzers">
|
||||
<Rule Id="CA1001" Action="None" /> <!-- Types that own disposable fields should be disposable -->
|
||||
<Rule Id="CA1019" Action="None" /> <!-- Define accessors for attribute arguments -->
|
||||
<Rule Id="CA1032" Action="None" /> <!-- Implement standard exception constructors -->
|
||||
<Rule Id="CA1065" Action="None" /> <!-- Do not raise exceptions in unexpected locations -->
|
||||
<Rule Id="CA1200" Action="None" /> <!-- Avoid using cref tags with a prefix -->
|
||||
<Rule Id="CA1507" Action="None" /> <!-- Use nameof to express symbol names -->
|
||||
<Rule Id="CA1812" Action="None" /> <!-- Avoid uninstantiated internal classes -->
|
||||
<Rule Id="CA2200" Action="None" /> <!-- Rethrow to preserve stack details -->
|
||||
<Rule Id="CA2234" Action="None" /> <!-- Pass system uri objects instead of strings -->
|
||||
<Rule Id="Async001" Action="None" />
|
||||
<Rule Id="Async002" Action="None" />
|
||||
<Rule Id="Async003" Action="None" />
|
||||
<Rule Id="Async004" Action="None" />
|
||||
<Rule Id="Async005" Action="None" />
|
||||
<Rule Id="Async006" Action="None" />
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.NetCore.Analyzers" RuleNamespace="Microsoft.NetCore.Analyzers">
|
||||
<Rule Id="CA2301" Action="Warning" /> <!-- Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder -->
|
||||
<Rule Id="CA2302" Action="Warning" /> <!-- Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize -->
|
||||
<Rule Id="CA2305" Action="Warning" /> <!-- Do not use insecure deserializer LosFormatter -->
|
||||
<Rule Id="CA2311" Action="Warning" /> <!-- Do not deserialize without first setting NetDataContractSerializer.Binder -->
|
||||
<Rule Id="CA2312" Action="Warning" /> <!-- Ensure NetDataContractSerializer.Binder is set before deserializing -->
|
||||
<Rule Id="CA2315" Action="Warning" /> <!-- Do not use insecure deserializer ObjectStateFormatter -->
|
||||
<Rule Id="CA2321" Action="Warning" /> <!-- Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver -->
|
||||
<Rule Id="CA2327" Action="Warning" /> <!-- Do not use insecure JsonSerializerSettings -->
|
||||
<Rule Id="CA2328" Action="Warning" /> <!-- Ensure that JsonSerializerSettings are secure -->
|
||||
<Rule Id="CA2329" Action="Warning" /> <!-- Do not deserialize with JsonSerializer using an insecure configuration -->
|
||||
<Rule Id="CA2330" Action="Warning" /> <!-- Ensure that JsonSerializer has a secure configuration when deserializing -->
|
||||
<Rule Id="CA3061" Action="Warning" /> <!-- Do Not Add Schema By URL -->
|
||||
<Rule Id="CA5350" Action="Warning" /> <!-- Do Not Use Weak Cryptographic Algorithms -->
|
||||
<Rule Id="CA5351" Action="Warning" /> <!-- Do Not Use Broken Cryptographic Algorithms -->
|
||||
<Rule Id="CA5358" Action="Warning" /> <!-- Review cipher mode usage with cryptography experts -->
|
||||
<Rule Id="CA5361" Action="Warning" /> <!-- Do Not Disable SChannel Use of Strong Crypto -->
|
||||
<Rule Id="CA5364" Action="Warning" /> <!-- Do Not Use Deprecated Security Protocols -->
|
||||
<Rule Id="CA5378" Action="Warning" /> <!-- Do not disable ServicePointManagerSecurityProtocols -->
|
||||
<Rule Id="CA5397" Action="Warning" /> <!-- Do not use deprecated SslProtocols values -->
|
||||
<Rule Id="CA2322" Action="Info" /> <!-- Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver before deserializing -->
|
||||
<Rule Id="CA2350" Action="Info" /> <!-- Do not use DataTable.ReadXml() with untrusted data -->
|
||||
<Rule Id="CA2351" Action="Info" /> <!-- Do not use DataSet.ReadXml() with untrusted data -->
|
||||
<Rule Id="CA2352" Action="Info" /> <!-- Unsafe DataSet or DataTable in serializable type can be vulnerable to remote code execution attacks -->
|
||||
<Rule Id="CA2353" Action="Info" /> <!-- Unsafe DataSet or DataTable in serializable type -->
|
||||
<Rule Id="CA2354" Action="Info" /> <!-- Unsafe DataSet or DataTable in deserialized object graph can be vulnerable to remote code execution attacks -->
|
||||
<Rule Id="CA2355" Action="Info" /> <!-- Unsafe DataSet or DataTable type found in deserializable object graph -->
|
||||
<Rule Id="CA2356" Action="Info" /> <!-- Unsafe DataSet or DataTable type in web deserializable object graph -->
|
||||
<Rule Id="CA2361" Action="Info" /> <!-- Ensure autogenerated class containing DataSet.ReadXml() is not used with untrusted data -->
|
||||
<Rule Id="CA2362" Action="Info" /> <!-- Unsafe DataSet or DataTable in autogenerated serializable type can be vulnerable to remote code execution attacks -->
|
||||
<Rule Id="CA3001" Action="Info" /> <!-- Review code for SQL injection vulnerabilities -->
|
||||
<Rule Id="CA3002" Action="Info" /> <!-- Review code for XSS vulnerabilities -->
|
||||
<Rule Id="CA3003" Action="Info" /> <!-- Review code for file path injection vulnerabilities -->
|
||||
<Rule Id="CA3004" Action="Info" /> <!-- Review code for information disclosure vulnerabilities -->
|
||||
<Rule Id="CA3005" Action="Info" /> <!-- Review code for LDAP injection vulnerabilities -->
|
||||
<Rule Id="CA3006" Action="Info" /> <!-- Review code for process command injection vulnerabilities -->
|
||||
<Rule Id="CA3007" Action="Info" /> <!-- Review code for open redirect vulnerabilities -->
|
||||
<Rule Id="CA3008" Action="Info" /> <!-- Review code for XPath injection vulnerabilities -->
|
||||
<Rule Id="CA3009" Action="Info" /> <!-- Review code for XML injection vulnerabilities -->
|
||||
<Rule Id="CA3010" Action="Info" /> <!-- Review code for XAML injection vulnerabilities -->
|
||||
<Rule Id="CA3011" Action="Info" /> <!-- Review code for DLL injection vulnerabilities -->
|
||||
<Rule Id="CA3012" Action="Info" /> <!-- Review code for regex injection vulnerabilities -->
|
||||
<Rule Id="CA5359" Action="Info" /> <!-- Do Not Disable Certificate Validation -->
|
||||
<Rule Id="CA5380" Action="Info" /> <!-- Do Not Add Certificates To Root Store -->
|
||||
<Rule Id="CA5381" Action="Info" /> <!-- Ensure Certificates Are Not Added To Root Store -->
|
||||
<Rule Id="CA5386" Action="Info" /> <!-- Avoid hardcoding SecurityProtocolType value -->
|
||||
<Rule Id="CA5391" Action="Info" /> <!-- Use antiforgery tokens in ASP.NET Core MVC controllers -->
|
||||
<Rule Id="CA5395" Action="Info" /> <!-- Miss HttpVerb attribute for action methods -->
|
||||
<Rule Id="CA5396" Action="Info" /> <!-- Set HttpOnly to true for HttpCookie -->
|
||||
<Rule Id="CA5398" Action="Info" /> <!-- Avoid hardcoded SslProtocols values -->
|
||||
<Rule Id="CA1303" Action="None" /> <!-- Do not pass literals as localized parameters -->
|
||||
<Rule Id="CA1304" Action="None" /> <!-- Specify CultureInfo -->
|
||||
<Rule Id="CA1305" Action="None" /> <!-- Specify IFormatProvider -->
|
||||
<Rule Id="CA1307" Action="None" /> <!-- Specify StringComparison -->
|
||||
<Rule Id="CA1308" Action="None" /> <!-- Normalize strings to uppercase -->
|
||||
<Rule Id="CA1401" Action="None" /> <!-- P/Invokes should not be visible -->
|
||||
<Rule Id="CA1417" Action="None" /> <!-- Do not use 'OutAttribute' on string parameters for P/Invokes -->
|
||||
<Rule Id="CA1810" Action="None" /> <!-- Initialize reference type static fields inline -->
|
||||
<Rule Id="CA1813" Action="None" /> <!-- Avoid unsealed attributes -->
|
||||
<Rule Id="CA1816" Action="None" /> <!-- Dispose methods should call SuppressFinalize -->
|
||||
<Rule Id="CA1820" Action="None" /> <!-- Test for empty strings using string length -->
|
||||
<Rule Id="CA1826" Action="None" /> <!-- Do not use Enumerable methods on indexable collections -->
|
||||
<Rule Id="CA1827" Action="None" /> <!-- Do not use Count() or LongCount() when Any() can be used -->
|
||||
<Rule Id="CA1828" Action="None" /> <!-- Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used -->
|
||||
<Rule Id="CA1829" Action="None" /> <!-- Use Length/Count property instead of Count() when available -->
|
||||
<Rule Id="CA1830" Action="None" /> <!-- Prefer strongly-typed Append and Insert method overloads on StringBuilder -->
|
||||
<Rule Id="CA1831" Action="None" /> <!-- Use AsSpan or AsMemory instead of Range-based indexers when appropriate -->
|
||||
<Rule Id="CA1832" Action="None" /> <!-- Use AsSpan or AsMemory instead of Range-based indexers when appropriate -->
|
||||
<Rule Id="CA1833" Action="None" /> <!-- Use AsSpan or AsMemory instead of Range-based indexers when appropriate -->
|
||||
<Rule Id="CA1834" Action="None" /> <!-- Consider using 'StringBuilder.Append(char)' when applicable -->
|
||||
<Rule Id="CA1835" Action="None" /> <!-- Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync' -->
|
||||
<Rule Id="CA1836" Action="None" /> <!-- Prefer IsEmpty over Count -->
|
||||
<Rule Id="CA1837" Action="None" /> <!-- Use 'Environment.ProcessId' -->
|
||||
<Rule Id="CA1838" Action="None" /> <!-- Avoid 'StringBuilder' parameters for P/Invokes -->
|
||||
<Rule Id="CA2000" Action="None" /> <!-- Dispose objects before losing scope -->
|
||||
<Rule Id="CA2002" Action="None" /> <!-- Do not lock on objects with weak identity -->
|
||||
<Rule Id="CA2008" Action="None" /> <!-- Do not create tasks without passing a TaskScheduler -->
|
||||
<Rule Id="CA2009" Action="None" /> <!-- Do not call ToImmutableCollection on an ImmutableCollection value -->
|
||||
<Rule Id="CA2012" Action="None" /> <!-- Use ValueTasks correctly -->
|
||||
<Rule Id="CA2013" Action="None" /> <!-- Do not use ReferenceEquals with value types -->
|
||||
<Rule Id="CA2014" Action="None" /> <!-- Do not use stackalloc in loops -->
|
||||
<Rule Id="CA2015" Action="None" /> <!-- Do not define finalizers for types derived from MemoryManager<T> -->
|
||||
<Rule Id="CA2100" Action="None" /> <!-- Review SQL queries for security vulnerabilities -->
|
||||
<Rule Id="CA2101" Action="None" /> <!-- Specify marshaling for P/Invoke string arguments -->
|
||||
<Rule Id="CA2201" Action="None" /> <!-- Do not raise reserved exception types -->
|
||||
<Rule Id="CA2207" Action="None" /> <!-- Initialize value type static fields inline -->
|
||||
<Rule Id="CA2208" Action="None" /> <!-- Instantiate argument exceptions correctly -->
|
||||
<Rule Id="CA2213" Action="None" /> <!-- Disposable fields should be disposed -->
|
||||
<Rule Id="CA2215" Action="None" /> <!-- Dispose methods should call base class dispose -->
|
||||
<Rule Id="CA2216" Action="None" /> <!-- Disposable types should declare finalizer -->
|
||||
<Rule Id="CA2229" Action="None" /> <!-- Implement serialization constructors -->
|
||||
<Rule Id="CA2235" Action="None" /> <!-- Mark all non-serializable fields -->
|
||||
<Rule Id="CA2237" Action="None" /> <!-- Mark ISerializable types with serializable -->
|
||||
<Rule Id="CA2241" Action="None" /> <!-- Provide correct arguments to formatting methods -->
|
||||
<Rule Id="CA2242" Action="None" /> <!-- Test for NaN correctly -->
|
||||
<Rule Id="CA2243" Action="None" /> <!-- Attribute string literals should parse correctly -->
|
||||
<Rule Id="CA2247" Action="None" /> <!-- Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum -->
|
||||
<Rule Id="CA2248" Action="None" /> <!-- Provide correct 'enum' argument to 'Enum.HasFlag' -->
|
||||
<Rule Id="CA2249" Action="None" /> <!-- Consider using 'string.Contains' instead of 'string.IndexOf' -->
|
||||
<Rule Id="CA2300" Action="None" /> <!-- Do not use insecure deserializer BinaryFormatter -->
|
||||
<Rule Id="CA2310" Action="None" /> <!-- Do not use insecure deserializer NetDataContractSerializer -->
|
||||
<Rule Id="CA2326" Action="None" /> <!-- Do not use TypeNameHandling values other than None -->
|
||||
<Rule Id="CA5360" Action="None" /> <!-- Do Not Call Dangerous Methods In Deserialization -->
|
||||
<Rule Id="CA5362" Action="None" /> <!-- Potential reference cycle in deserialized object graph -->
|
||||
<Rule Id="CA5363" Action="None" /> <!-- Do Not Disable Request Validation -->
|
||||
<Rule Id="CA5365" Action="None" /> <!-- Do Not Disable HTTP Header Checking -->
|
||||
<Rule Id="CA5366" Action="None" /> <!-- Use XmlReader For DataSet Read Xml -->
|
||||
<Rule Id="CA5367" Action="None" /> <!-- Do Not Serialize Types With Pointer Fields -->
|
||||
<Rule Id="CA5368" Action="None" /> <!-- Set ViewStateUserKey For Classes Derived From Page -->
|
||||
<Rule Id="CA5369" Action="None" /> <!-- Use XmlReader For Deserialize -->
|
||||
<Rule Id="CA5370" Action="None" /> <!-- Use XmlReader For Validating Reader -->
|
||||
<Rule Id="CA5371" Action="None" /> <!-- Use XmlReader For Schema Read -->
|
||||
<Rule Id="CA5372" Action="None" /> <!-- Use XmlReader For XPathDocument -->
|
||||
<Rule Id="CA5373" Action="None" /> <!-- Do not use obsolete key derivation function -->
|
||||
<Rule Id="CA5374" Action="None" /> <!-- Do Not Use XslTransform -->
|
||||
<Rule Id="CA5375" Action="None" /> <!-- Do Not Use Account Shared Access Signature -->
|
||||
<Rule Id="CA5376" Action="None" /> <!-- Use SharedAccessProtocol HttpsOnly -->
|
||||
<Rule Id="CA5377" Action="None" /> <!-- Use Container Level Access Policy -->
|
||||
<Rule Id="CA5379" Action="None" /> <!-- Do Not Use Weak Key Derivation Function Algorithm -->
|
||||
<Rule Id="CA5382" Action="None" /> <!-- Use Secure Cookies In ASP.Net Core -->
|
||||
<Rule Id="CA5383" Action="None" /> <!-- Ensure Use Secure Cookies In ASP.Net Core -->
|
||||
<Rule Id="CA5384" Action="None" /> <!-- Do Not Use Digital Signature Algorithm (DSA) -->
|
||||
<Rule Id="CA5385" Action="None" /> <!-- Use Rivest–Shamir–Adleman (RSA) Algorithm With Sufficient Key Size -->
|
||||
<Rule Id="CA5387" Action="None" /> <!-- Do Not Use Weak Key Derivation Function With Insufficient Iteration Count -->
|
||||
<Rule Id="CA5388" Action="None" /> <!-- Ensure Sufficient Iteration Count When Using Weak Key Derivation Function -->
|
||||
<Rule Id="CA5389" Action="None" /> <!-- Do Not Add Archive Item's Path To The Target File System Path -->
|
||||
<Rule Id="CA5390" Action="None" /> <!-- Do not hard-code encryption key -->
|
||||
<Rule Id="CA5392" Action="None" /> <!-- Use DefaultDllImportSearchPaths attribute for P/Invokes -->
|
||||
<Rule Id="CA5393" Action="None" /> <!-- Do not use unsafe DllImportSearchPath value -->
|
||||
<Rule Id="CA5394" Action="None" /> <!-- Do not use insecure randomness -->
|
||||
<Rule Id="CA5399" Action="None" /> <!-- HttpClients should enable certificate revocation list checks -->
|
||||
<Rule Id="CA5400" Action="None" /> <!-- Ensure HttpClient certificate revocation list check is not disabled -->
|
||||
<Rule Id="CA5401" Action="None" /> <!-- Do not use CreateEncryptor with non-default IV -->
|
||||
<Rule Id="CA5402" Action="None" /> <!-- Use CreateEncryptor with the default IV -->
|
||||
<Rule Id="CA5403" Action="None" /> <!-- Do not hard-code certificate -->
|
||||
<Rule Id="IL3000" Action="None" /> <!-- Avoid using accessing Assembly file path when publishing as a single-file -->
|
||||
<Rule Id="IL3001" Action="None" /> <!-- Avoid using accessing Assembly file path when publishing as a single-file -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.NetCore.CSharp.Analyzers" RuleNamespace="Microsoft.NetCore.CSharp.Analyzers">
|
||||
<Rule Id="CA1309" Action="None" /> <!-- Use ordinal stringcomparison -->
|
||||
<Rule Id="CA1824" Action="None" /> <!-- Mark assemblies with NeutralResourcesLanguageAttribute -->
|
||||
<Rule Id="CA1825" Action="None" /> <!-- Avoid zero-length array allocations -->
|
||||
<Rule Id="CA2016" Action="None" /> <!-- Forward the 'CancellationToken' parameter to methods that take one -->
|
||||
<Rule Id="CA2010" Action="None" />
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.NetFramework.Analyzers" RuleNamespace="Microsoft.NetFramework.Analyzers">
|
||||
<Rule Id="CA2153" Action="Warning" /> <!-- Do Not Catch Corrupted State Exceptions -->
|
||||
<Rule Id="CA3075" Action="Warning" /> <!-- Insecure DTD processing in XML -->
|
||||
<Rule Id="CA3147" Action="Warning" /> <!-- Mark Verb Handlers With Validate Antiforgery Token -->
|
||||
<Rule Id="CA1058" Action="None" /> <!-- Types should not extend certain base types -->
|
||||
</Rules>
|
||||
|
||||
<Rules AnalyzerId="Microsoft.NetFramework.CSharp.Analyzers" RuleNamespace="Microsoft.NetFramework.CSharp.Analyzers">
|
||||
<Rule Id="CA3076" Action="Warning" /> <!-- Insecure XSLT script processing. -->
|
||||
<Rule Id="CA3077" Action="Warning" /> <!-- Insecure Processing in API Design, XmlDocument and XmlTextReader -->
|
||||
</Rules>
|
||||
</RuleSet>
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"$schema":
|
||||
"https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
||||
"settings": {
|
||||
"orderingRules": {
|
||||
"usingDirectivesPlacement": "outsideNamespace",
|
||||
"systemUsingDirectivesFirst": false,
|
||||
"blankLinesBetweenUsingGroups": "require"
|
||||
},
|
||||
"documentationRules": {
|
||||
"companyName": "Microsoft Corporation",
|
||||
"copyrightText": "Copyright (c) {companyName}. All rights reserved.\n\nLicensed under the MIT license.",
|
||||
"xmlHeader": false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
##########################################
|
||||
# StyleCop
|
||||
##########################################
|
||||
|
||||
[*]
|
||||
# SA0001: XML comment analysis is disabled due to project configuration
|
||||
# Justification: Comments turned off
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA0001.md
|
||||
dotnet_diagnostic.SA0001.severity = none
|
||||
|
||||
[*.cs]
|
||||
# SA1600: A C# code element is missing a documentation header.
|
||||
# Justification: Comments turned off
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1600.md
|
||||
dotnet_diagnostic.SA1600.severity = none
|
||||
|
||||
# SA1601: A C# partial element is missing a documentation header.
|
||||
# Justification: Comments turned off
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1601.md
|
||||
dotnet_diagnostic.SA1601.severity = none
|
||||
|
||||
# SA1602: An item within a C# enumeration is missing an XML documentation header.
|
||||
# Justification: Comments turned off
|
||||
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1602.md
|
||||
dotnet_diagnostic.SA1602.severity = none
|
||||
|
||||
##########################################
|
||||
# Custom
|
||||
##########################################
|
||||
|
||||
[*.cs]
|
||||
# CA1062: Validate arguments of public methods
|
||||
# Justification: xUnit Theory method parameters don't need to be validated
|
||||
# https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1062
|
||||
dotnet_diagnostic.CA1062.severity = none
|
||||
|
||||
# CA1707: Identifiers should not contain underscores
|
||||
# Justification: Test method names contain underscores
|
||||
# https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1707
|
||||
dotnet_diagnostic.CA1707.severity = none
|
|
@ -1,19 +1,18 @@
|
|||
<Project>
|
||||
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"/>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"/>
|
||||
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
|
||||
<PackageReference Include="MSTest.TestAdapter"/>
|
||||
<PackageReference Include="MSTest.TestFramework"/>
|
||||
<PackageReference Include="Moq"/>
|
||||
<PackageReference Include="FluentAssertions"/>
|
||||
<PackageReference Include="Faker.net" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Build">
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)../analyzers.ruleset</CodeAnalysisRuleSet>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<NoWarn>NU1608,NU5119,NU5100</NoWarn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
|
||||
<PackageReference Include="MSTest.TestAdapter"/>
|
||||
<PackageReference Include="MSTest.TestFramework"/>
|
||||
<PackageReference Include="Moq"/>
|
||||
<PackageReference Include="FluentAssertions"/>
|
||||
<PackageReference Include="Faker.net"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Загрузка…
Ссылка в новой задаче