winforms/.editorconfig

664 строки
22 KiB
INI

# editorconfig.org
# top-most EditorConfig file
root = true
# Default settings:
# A newline ending every file
# Use 4 spaces as indentation
[*]
guidelines = 120 1px dotted 504CFF00, 150 1px dotted 50FF6A00
indent_style = space
indent_size = 4
[*.json]
indent_size = 2
# Bvc.dll crashed in the CI build when this rule is enabled for VB.
# C# files
[src/**/*.cs]
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.
# C# and VB files
[*.{cs,vb}]
charset = utf-8-bom
insert_final_newline = true
trim_trailing_whitespace = true
# avoid this. unless absolutely necessary
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error
# use language keywords instead of BCL types
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
# name all constant fields using PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# static fields should have s_ prefix
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_style.static_prefix_style.required_prefix = s_
dotnet_naming_style.static_prefix_style.capitalization = camel_case
# internal and private fields should be _camelCase
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
# Code style defaults
dotnet_sort_system_directives_first = true
# Expression-level preferences
dotnet_style_object_initializer = true:warning
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_simplified_boolean_expressions = true:warning
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
end_of_line = crlf
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
dotnet_style_prefer_collection_expression = when_types_exactly_match:warning
# IDE0040: Add accessibility modifiers
dotnet_diagnostic.IDE0040.severity = error
# CA1036: Override methods on comparable types
dotnet_diagnostic.CA1036.severity = warning
# CA1051: Do not declare visible instance fields
dotnet_diagnostic.CA1051.severity = error
# CA1507: Use nameof in place of string
dotnet_diagnostic.CA1507.severity = error
# CA1511: Use ArgumentException throw helper
dotnet_diagnostic.CA1511.severity = error
# CA1512: Use ArgumentOutOfRangeException throw helper
dotnet_diagnostic.CA1512.severity = error
# CA1513: Use ObjectDisposedException throw helper
dotnet_diagnostic.CA1513.severity = error
# CA1805: Do not initialize unnecessarily
dotnet_diagnostic.CA1805.severity = warning
# CA1812: Remove empty finalizers
dotnet_diagnostic.CA1821.severity = error
# CA1825: Avoid zero-length array allocations
dotnet_diagnostic.CA1825.severity = error
# CA1826: Use property instead of Linq Enumerable method
dotnet_diagnostic.CA1826.severity = error
# CA1827: Do not use Count()/LongCount() when Any() can be used
dotnet_diagnostic.CA1827.severity = error
# CA1828: Do not use CountAsync/LongCountAsync when AnyAsync can be used
dotnet_diagnostic.CA1828.severity = error
# CA1829: Use Length/Count property instead of Enumerable.Count method
dotnet_diagnostic.CA1829.severity = error
# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
dotnet_diagnostic.CA1830.severity = error
# CA1831: Use AsSpan instead of Range-based indexers for string when appropriate
dotnet_diagnostic.CA1831.severity = error
# CA1832: Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array
dotnet_diagnostic.CA1832.severity = error
# CA1833: Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array
dotnet_diagnostic.CA1833.severity = error
# CA1834: Use StringBuilder.Append(char) for single character strings
dotnet_diagnostic.CA1834.severity = error
# CA1835: Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes
dotnet_diagnostic.CA1835.severity = error
# CA1836: Prefer IsEmpty over Count when available
dotnet_diagnostic.CA1836.severity = error
# CA1837: Use Environment.ProcessId instead of Process.GetCurrentProcess().Id
dotnet_diagnostic.CA1837.severity = error
# CA1838: Avoid StringBuilder parameters for P/Invokes
dotnet_diagnostic.CA1838.severity = error
# CA1839: Use Environment.ProcessPath instead of Process.GetCurrentProcess().MainModule.FileName
dotnet_diagnostic.CA1839.severity = error
# CA1840: Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId
dotnet_diagnostic.CA1840.severity = error
# CA1841: Prefer Dictionary Contains methods
dotnet_diagnostic.CA1841.severity = error
# CA1842: Do not use 'WhenAll' with a single task
dotnet_diagnostic.CA1842.severity = error
# CA1843: Do not use 'WaitAll' with a single task
dotnet_diagnostic.CA1843.severity = error
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
dotnet_diagnostic.CA1844.severity = error
# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
dotnet_diagnostic.CA1847.severity = error
# CA1848: Use the LoggerMessage delegates
dotnet_diagnostic.CA1848.severity = error
# CA1850: Prefer static HashData method over ComputeHash
dotnet_diagnostic.CA1850.severity = error
# CA1851: Possible multiple enumerations of IEnumerable collection
dotnet_diagnostic.CA1851.severity = error
# CA1852: Seal internal types
dotnet_diagnostic.CA1852.severity = error
# CA1853: Unnecessary call to 'Dictionary.ContainsKey(key)'
dotnet_diagnostic.CA1853.severity = error
# CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method
dotnet_diagnostic.CA1854.severity = error
# CA1858: Use StartsWith instead of IndexOf
dotnet_diagnostic.CA1858.severity = error
# CA1860: Avoid using 'Enumerable.Any()' extension method
dotnet_diagnostic.CA1860.severity = error
# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value
dotnet_diagnostic.CA2009.severity = warning
# CA2011: Do not assign property within its setter
dotnet_diagnostic.CA2011.severity = warning
# CA2012: Use ValueTasks correctly
dotnet_diagnostic.CA2012.severity = warning
# CA2019: ThreadStatic fields should not use inline initialization
dotnet_diagnostic.CA2019.severity = warning
# CA2208: Instantiate argument exceptions correctly
dotnet_diagnostic.CA2208.severity = error
# CA2211: Non-constant fields should not be visible
dotnet_diagnostic.CA2211.severity = error
# CA2241: Provide correct arguments to formatting methods
dotnet_diagnostic.CA2241.severity = error
# CA2245: Do not assign a property to itself
dotnet_diagnostic.CA2245.severity = error
# CA2248: Provide correct enumm argument to Enum.HasFlag
dotnet_diagnostic.CA2248.severity = error
# CA2249: Consider using String.Contains instead of String.IndexOf
dotnet_diagnostic.CA2249.severity = error
# CA2242: Test for NaN correctly
dotnet_diagnostic.CA2242.severity = error
# CA2251: Use String.Equals over String.Compare
dotnet_diagnostic.CA2251.severity = error
# CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2201.severity = error
# CA2219: Do not raise exceptions in exception clauses
dotnet_diagnostic.CA2219.severity = error
# CA3061: Do not add schema by URL
dotnet_diagnostic.CA3061.severity = warning
# CA3075: Insecure DTD Processing
dotnet_diagnostic.CA3075.severity = warning
# CA3076: Insecure XSLT Script Execution
dotnet_diagnostic.CA3076.severity = warning
# CA3077: Insecure Processing in API Design, XML Document and XML Text Reader
dotnet_diagnostic.CA3077.severity = warning
# CA3147: Mark verb handlers with ValidateAntiForgeryToken
dotnet_diagnostic.CA3147.severity = warning
# CA5350: Do Not Use Weak Cryptographic Algorithms
dotnet_diagnostic.CA5350.severity = warning
# CA5351: Do Not Use Broken Cryptographic Algorithms
dotnet_diagnostic.CA5351.severity = warning
# CA5359: Do not disable certificate validation
dotnet_diagnostic.CA5359.severity = warning
# CA5360: Do not call dangerous methods in deserialization
dotnet_diagnostic.CA5360.severity = warning
# CA5363: Do not disable request validation
dotnet_diagnostic.CA5363.severity = warning
# CA5364: Do not use deprecated security protocols
dotnet_diagnostic.CA5364.severity = warning
# CA5365: Do Not Disable HTTP Header Checking
dotnet_diagnostic.CA5365.severity = warning
# CA5366: Use XmlReader For DataSet Read XML
dotnet_diagnostic.CA5366.severity = warning
# CA5368: Set ViewStateUserKey For Classes Derived From Page
dotnet_diagnostic.CA5368.severity = warning
# CA5369: Use XmlReader for Deserialize
dotnet_diagnostic.CA5369.severity = warning
# CA5370: Use XmlReader for validating reader
dotnet_diagnostic.CA5370.severity = warning
# CA5371: Use XmlReader for schema read
dotnet_diagnostic.CA5371.severity = warning
# CA5372: Use XmlReader for XPathDocument
dotnet_diagnostic.CA5372.severity = warning
# CA5373: Do not use obsolete key derivation function
dotnet_diagnostic.CA5373.severity = warning
# CA5374: Do not use XslTransform
dotnet_diagnostic.CA5374.severity = warning
# CA5375: Do not use account shared access signature
dotnet_diagnostic.CA5379.severity = warning
# CA5384: Do not use digital signature algorithm (DSA)
dotnet_diagnostic.CA5384.severity = warning
# CA5385: Use Rivest-Shamir-Adleman (RSA) algorithm with sufficient key size
dotnet_diagnostic.CA5385.severity = warning
# CA5387: Do not use weak key derivation function with insufficient iteration count
dotnet_diagnostic.CA5397.severity = warning
# RS0041: Public members should not use oblivious types
dotnet_diagnostic.RS0041.severity = warning
# C# files
[*.cs]
# CSIsNull001: Use 'is' pattern check
dotnet_diagnostic.CSIsNull001.severity = error
# CSIsNull002: Use 'is not' pattern check
dotnet_diagnostic.CSIsNull002.severity = error
# SYSLIB1045: Convert to 'GeneratedRegexAttribute'.
dotnet_diagnostic.SYSLIB1045.severity = error
# These two (1054 and 1096) conflict with our usage of CsWin32
# SYSLIB1054: Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
dotnet_diagnostic.SYSLIB1054.severity = none
# SYSLIB1096: Convert to 'GeneratedComInterface'
dotnet_diagnostic.SYSLIB1096.severity = none
# CA1047: Do not declare protected members in sealed types
dotnet_diagnostic.CA1047.severity = error
# CA1310: Specify StringComparison for correctness
dotnet_diagnostic.CA1310.severity = error
# CA1510: Use ArgumentNullException throw helper
dotnet_diagnostic.CA1510.severity = error
# CA1514: Avoid redundant length argument
dotnet_diagnostic.CA1514.severity = error
# CA1725: Parameter names should match base declaration
dotnet_diagnostic.CA1725.severity = error
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = warning
# CA2244: Do not duplicate indexed element initializations
dotnet_diagnostic.CA2244.severity = error
# CA1845: Use span-based 'string.Concat'
dotnet_diagnostic.CA1845.severity = error
# CA1846: Prefer AsSpan over Substring
dotnet_diagnostic.CA1846.severity = error
# CA2246: Do not assign a symbol and its member in the same statement
dotnet_diagnostic.CA2246.severity = error
# CA1855: Use Span<T>.Clear() instead of Span<T>.Fill()
dotnet_diagnostic.CA1855.severity = error
# CA1857: The parameter expects a constant for optimal performance
dotnet_diagnostic.CA1857.severity = error
# CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1859.severity = error
# DOC100: Place text in paragraphs
dotnet_diagnostic.DOC100.severity = error
# DOC101: Use child blocks consistently
dotnet_diagnostic.DOC101.severity = warning
# DOC102: Use child blocks consistently across elements of the same kind
dotnet_diagnostic.DOC102.severity = warning
# DOC103: Use Unicode characters instead of HTML entities
dotnet_diagnostic.DOC103.severity = error
# DOC104: Use see langword
dotnet_diagnostic.DOC104.severity = warning
# DOC105: Use paramref
dotnet_diagnostic.DOC105.severity = warning
# DOC106: Use typeparamref
dotnet_diagnostic.DOC106.severity = warning
# DOC107: Use see cref
dotnet_diagnostic.DOC107.severity = warning
# DOC108: Avoid empty paragraphs
dotnet_diagnostic.DOC108.severity = warning
# IDE0002: Simplify Member Access
dotnet_diagnostic.IDE0002.severity = error
# IDE0003: Remove qualification
dotnet_diagnostic.IDE0003.severity = error
# IDE0004: Remove unnecessary cast
dotnet_diagnostic.IDE0004.severity = warning
# IDE0017: Simplify object initialization
dotnet_diagnostic.IDE0017.severity = warning
# IDE0019: Use pattern matching
dotnet_diagnostic.IDE0019.severity = warning
# IDE0031: Use null propagation
dotnet_diagnostic.IDE0031.severity = warning
# IDE0038: Use pattern matching
dotnet_diagnostic.IDE0038.severity = warning
# IDE0043: Invalid format string
dotnet_diagnostic.IDE0043.severity = warning
# IDE0044: Add readonly modifier
dotnet_diagnostic.IDE0044.severity = warning
# IDE0049: Simplify Names
dotnet_diagnostic.IDE0049.severity = warning
# IDE0051: Remove unused private members
dotnet_diagnostic.IDE0051.severity = warning
# IDE0052: Remove unread private members
dotnet_diagnostic.IDE0052.severity = warning
# IDE0057: Use range operator
dotnet_diagnostic.IDE0057.severity = error
# IDE0060: Remove unused parameter
dotnet_diagnostic.IDE0060.severity = warning
# IDE0063: Use simple 'using' statement
dotnet_diagnostic.IDE0063.severity = warning
# IDE0064: Make struct fields writable
dotnet_diagnostic.IDE0064.severity = warning
# IDE0066: Convert switch statement to expression
dotnet_diagnostic.IDE0066.severity = warning
# IDE0075: Simplify conditional expression
dotnet_diagnostic.IDE0075.severity = warning
# IDE0076: Invalid global suppression
dotnet_diagnostic.IDE0076.severity = warning
# IDE0077: Avoid legacy global suppression format
dotnet_diagnostic.IDE0077.severity = warning
# IDE0078: Use pattern matching
dotnet_diagnostic.IDE0078.severity = warning
# IDE0079: Remove unnecessary suppression
dotnet_diagnostic.IDE0079.severity = error
# IDE0180: Use tuple to swap values
dotnet_diagnostic.IDE0180.severity = warning
# IDE0251: Make member 'readonly'
dotnet_diagnostic.IDE0251.severity = warning
# IDE0270: Use coalesce expression
dotnet_diagnostic.IDE0270.severity = warning
# IDE0300: Simplify collection initialization
dotnet_diagnostic.IDE0300.severity = warning
# IDE1006: Naming Styles
dotnet_diagnostic.IDE1006.severity = error
# CA1070: Do not declare event fields as virtual
dotnet_diagnostic.CA1070.severity = error
# CA2016: Forward the CancellationToken parameter to methods that take one
dotnet_diagnostic.CA2016.severity = warning
# CA2020: Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr
dotnet_diagnostic.CA2020.severity = warning
# .NET diagnostic
dotnet_diagnostic.RS0041.severity = none
dotnet_diagnostic.IDE0005.severity = error
# Expression-level preferences
dotnet_style_coalesce_expression = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
# only use var when it's obvious what the variable type is
csharp_style_var_for_built_in_types = false:error
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = false:silent
# Code style defaults
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
# Expression-bodied members
csharp_style_expression_bodied_methods = true:silent
csharp_style_expression_bodied_constructors = true:silent
csharp_style_expression_bodied_operators = true:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_inlined_variable_declaration = true:suggestion
# Null checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_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_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:warning
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = file_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
csharp_style_deconstructed_variable_declaration = true:suggestion
# Visual Basic files
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
dotnet_separate_import_directive_groups = false:warning
# IDE0079: Remove unnecessary suppression
dotnet_diagnostic.IDE0079.severity = none
# Expression-level preferences
dotnet_style_coalesce_expression = false:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion
dotnet_style_prefer_conditional_expression_over_return = false:suggestion
# C++ Files
[*.{cpp,h,in}]
curly_bracket_next_line = true
indent_brace_style = Allman
# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
indent_size = 2
# Xml build files
[*.builds]
indent_size = 2
# Xml files
[*.{xml,stylecop,ruleset}]
indent_size = 2
# Xml config files
[*.{props,targets,config,nuspec}]
indent_size = 2
# resx Files
[*.{resx,xlf}]
indent_size = 2
charset = utf-8-bom
insert_final_newline = true
# Shell scripts
[*.sh]
end_of_line = lf
[*.{cmd,bat}]
end_of_line = crlf
# Test specific
[**/tests/**/*.cs]
# CA1861: Avoid constant arrays as arguments - expected to be inline for test readability (4000 hits)
dotnet_diagnostic.CA1861.severity = silent
# This collides with TheoryData usage
dotnet_style_prefer_collection_expression = true:silent
# This should be fixed https://github.com/dotnet/winforms/issues/11041
# xUnit1042: The member referenced by the MemberData attribute returns untyped data rows
dotnet_diagnostic.xUnit1042.severity = none
# CA1507: CA1507: Use nameof in place of string - many fasle positives
dotnet_diagnostic.CA1507.severity = none
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = suggestion
# CA1852: Seal internal types
dotnet_diagnostic.CA1852.severity = suggestion
# CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1859.severity = none