# editorconfig.org # top-most EditorConfig file root = true # All files [*] indent_style = space insert_final_newline = true trim_trailing_whitespace = true # (Please don't specify an indent_size here; that has too many unintended consequences.) vsspell_dictionary_languages = en-US vsspell_section_id = 842f80e2d4aa4288afdcd0e42833eeaf vsspell_ignored_words_842f80e2d4aa4288afdcd0e42833eeaf = runsettings|nullable|args|testhost|mutex|trx|vstest|arity|async|bool|inlined|json|jsonite|jsonrpc|localhost|readonly|xml|stylecop|indices|dotnet|lifecycle # Xml localization files [*.xlf] vsspell_spell_check_as_you_type = false vsspell_include_in_project_spell_check = false vsspell_code_analyzers_enabled = false # Shell scripts [*.sh] end_of_line = lf [*.{cmd,bat}] end_of_line = crlf # Visual Studio XML project files [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] indent_size = 2 charset = utf-8 # Visual Studio and .NET related XML config files [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct,stylecop}] indent_size = 2 # Xml files [*.{xml}] indent_size = 2 # YAML files [*.{yml,yaml}] indent_size = 2 # JSON files [*.json] indent_size = 2 # Markdown files [*.md] indent_size = 2 # PowerShell scripts [*.ps1] indent_size = 4 # Code files [*.{cs,csx,vb,vbx}] charset = utf-8-bom indent_size = 4 tab_width = 4 # Dotnet code style settings: [*.{cs,vb}] # Do not set end_of_line property, this is causing issues with Linux, # see https://github.com/dotnet/roslyn/issues/55526 #### .NET Coding Conventions #### ## Organize usings dotnet_separate_import_directive_groups = true dotnet_sort_system_directives_first = true ## License header file_header_template = Copyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the MIT license. See LICENSE file in the project root for full license information. ## Styling conventions # Code style defaults dotnet_code_quality_unused_parameters = all:suggestion # IDE0060: Remove unused parameter dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent dotnet_style_readonly_field = true:warning # IDE0044: Add readonly modifier dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent # IDE0040: Add accessibility modifiers # Expression-level preferences dotnet_style_coalesce_expression = true:warning dotnet_style_collection_initializer = true:warning # IDE0028: Use collection initializers dotnet_style_explicit_tuple_names = true:warning # IDE0033: Use explicitly provided tuple name dotnet_style_namespace_match_folder = false # IDE0130: Namespace does not match folder structure dotnet_style_object_initializer = true:warning # IDE0017: Use object initializers dotnet_style_operator_placement_when_wrapping = beginning_of_line dotnet_style_prefer_auto_properties = true:warning # IDE0032: Use auto-implemented property dotnet_style_prefer_compound_assignment = true:suggestion # IDE0054: Use compound assignment / IDE0074:Use coalesce compound assignment dotnet_style_prefer_conditional_expression_over_assignment = true:warning # IDE0045: Use conditional expression for assignment dotnet_style_prefer_conditional_expression_over_return = true:warning # IDE0046: Use conditional expression for return dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning # IDE0037: Use inferred member name dotnet_style_prefer_inferred_tuple_names = true:warning # IDE0037: Use inferred member name dotnet_style_prefer_simplified_boolean_expressions = true:warning # IDE0075: Simplify conditional expression dotnet_style_prefer_simplified_interpolation = true:suggestion # IDE0071: Simplify interpolation # Null-checking preferences csharp_style_conditional_delegate_call = true:warning # IDE1005: Use conditional delegate call csharp_style_prefer_null_check_over_type_check = true:warning # IDE0150: Prefer null check over type check csharp_style_throw_expression = true:warning # IDE0016: Use throw expression dotnet_style_coalesce_expression = true:warning # IDE0029: Use coalesce expression (non-nullable types) / IDE0030: Use coalesce expression (nullable types) dotnet_style_null_propagation = true:warning # IDE0031: Use null propagation dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning # IDE0041: Use 'is null' check # Avoid this. unless absolutely necessary (IDE0003 and IDE0009) dotnet_style_qualification_for_event = false:warning dotnet_style_qualification_for_field = false:warning dotnet_style_qualification_for_method = false:warning dotnet_style_qualification_for_property = false:warning # Types: use keywords instead of BCL types, and permit var only when the type is clear (IDE0049) dotnet_style_predefined_type_for_locals_parameters_members = true:warning dotnet_style_predefined_type_for_member_access = true:warning dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Remove unnecessary cast dotnet_diagnostic.IDE0005.severity = warning # IDE0005: Remove unnecessary using directives dotnet_diagnostic.IDE0011.severity = warning # IDE0011: Add braces dotnet_diagnostic.IDE0017.severity = warning # IDE0017: Simplify object initialization dotnet_diagnostic.IDE0018.severity = warning # IDE0018: Inline variable declaration dotnet_diagnostic.IDE0019.severity = warning # IDE0019: Use pattern matching to avoid 'as' followed by a 'null' check dotnet_diagnostic.IDE0020.severity = warning # IDE0020: IDE0038: Use pattern matching to avoid 'is' check followed by a cast dotnet_diagnostic.IDE0028.severity = warning # IDE0028: Simplify collection initialization dotnet_diagnostic.IDE0031.severity = warning # IDE0031: Use null propagation dotnet_style_null_propagation = true:warning # IDE0031: Use null propagation dotnet_diagnostic.IDE0032.severity = warning # IDE0032: Use auto-implemented property dotnet_diagnostic.IDE0034.severity = warning # IDE0034: Simplify 'default' expression dotnet_diagnostic.IDE0035.severity = warning # IDE0035: Remove unreachable code dotnet_diagnostic.IDE0036.severity = warning # IDE0036: Order modifiers dotnet_diagnostic.IDE0039.severity = warning # IDE0039: Use local function instead of lambda dotnet_diagnostic.IDE0040.severity = warning # IDE0040: Add accessibility modifiers dotnet_diagnostic.IDE0041.severity = warning # IDE0041: Use 'is null' check dotnet_diagnostic.IDE0043.severity = warning # IDE0043: Format string contains invalid placeholder dotnet_diagnostic.IDE0044.severity = warning # IDE0044: Make field readonly dotnet_diagnostic.IDE0045.severity = warning # IDE0045: Use conditional expression for assignment dotnet_diagnostic.IDE0046.severity = warning # IDE0046: Use conditional expression for return dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses preferences dotnet_diagnostic.IDE0048.severity = warning # IDE0048: Parentheses preferences dotnet_diagnostic.IDE0051.severity = warning # IDE0051: Remove unused private member dotnet_diagnostic.IDE0052.severity = warning # IDE0052: Remove unread private member dotnet_diagnostic.IDE0054.severity = warning # IDE0054: Use compound assignment dotnet_diagnostic.IDE0055.severity = warning # IDE0055: Fix formatting dotnet_diagnostic.IDE0056.severity = suggestion # IDE0056: Use index operator dotnet_diagnostic.IDE0057.severity = suggestion # IDE0057: Use range operator dotnet_diagnostic.IDE0059.severity = warning # IDE0059: Unnecessary assignment to a value dotnet_diagnostic.IDE0060.severity = warning # IDE0060: Remove unused parameter dotnet_diagnostic.IDE0062.severity = warning # IDE0062: Make local function static dotnet_diagnostic.IDE0063.severity = warning # IDE0063: Use simple 'using' statement dotnet_diagnostic.IDE0065.severity = warning # IDE0065: 'using' directive placement dotnet_diagnostic.IDE0066.severity = warning # IDE0066: Use switch expression dotnet_diagnostic.IDE0071.severity = warning # IDE0071: Simplify interpolation dotnet_diagnostic.IDE0073.severity = warning # IDE0073: File header dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use coalesce compound assignment dotnet_diagnostic.IDE0075.severity = warning # IDE0075: Simplify conditional expression dotnet_diagnostic.IDE0078.severity = warning # IDE0078: Use pattern matching dotnet_diagnostic.IDE0082.severity = warning # IDE0082: Convert typeof to nameof dotnet_diagnostic.IDE0083.severity = warning # IDE0083: Use pattern matching (not operator) dotnet_diagnostic.IDE0090.severity = warning # IDE0090: Use 'new(...)' dotnet_diagnostic.IDE0100.severity = warning # IDE0100: Remove unnecessary equality operator dotnet_diagnostic.IDE0120.severity = warning # IDE0120: Simplify LINQ expression dotnet_diagnostic.IDE0150.severity = warning # IDE0150: Prefer 'null' check over type check dotnet_diagnostic.IDE0161.severity = warning # IDE0160: IDE0161: Namespace declaration preferences dotnet_diagnostic.IDE0170.severity = warning # IDE0170: Prefer extended property pattern dotnet_diagnostic.IDE0220.severity = warning # IDE0220: Add explicit cast dotnet_diagnostic.IDE0240.severity = warning # IDE0240: Remove redundant nullable directive dotnet_diagnostic.IDE0241.severity = warning # IDE0241: Remove unnecessary nullable directive dotnet_diagnostic.IDE0250.severity = warning # IDE0250: Struct can be made 'readonly' dotnet_diagnostic.IDE0251.severity = warning # IDE0251: Member can be made 'readonly' dotnet_diagnostic.IDE0260.severity = warning # IDE0260: Use pattern matching dotnet_diagnostic.IDE0270.severity = warning # IDE0270: Use coalesce expression dotnet_diagnostic.IDE0280.severity = warning # IDE0280: Use 'nameof' dotnet_diagnostic.IDE1005.severity = warning # IDE1005: Use conditional delegate call dotnet_diagnostic.IDE1006.severity = warning # IDE1006: Naming rule violation dotnet_diagnostic.IDE2000.severity = warning # IDE2000: Avoid multiple blank lines dotnet_diagnostic.IDE2002.severity = warning dotnet_diagnostic.IDE2003.severity = warning dotnet_diagnostic.IDE2004.severity = warning dotnet_diagnostic.IDE2005.severity = warning dotnet_diagnostic.IDE2006.severity = warning dotnet_diagnostic.CA1000.severity = warning # CA1000: Do not declare static members on generic types dotnet_diagnostic.CA1001.severity = warning # CA1001: Types that own disposable fields should be disposable dotnet_diagnostic.CA1010.severity = warning # CA1010: Collections should implement generic interface dotnet_diagnostic.CA1012.severity = warning # CA1012: Abstract types should not have public constructors dotnet_diagnostic.CA1304.severity = warning # CA1304: Specify CultureInfo dotnet_diagnostic.CA1305.severity = warning # CA1305: Specify IFormatProvider dotnet_diagnostic.CA1309.severity = warning # CA1309: Use ordinal StringComparison dotnet_diagnostic.CA1310.severity = warning # CA1310: Specify StringComparison for correctness dotnet_diagnostic.CA1311.severity = warning # CA1311: Specify a culture or use an invariant version dotnet_diagnostic.CA1507.severity = warning # CA1507: Use nameof in place of string dotnet_diagnostic.CA1510.severity = none # CA1510: Use ArgumentNullException throw helper dotnet_diagnostic.CA1708.severity = warning # CA1708: Identifiers should differ by more than case dotnet_diagnostic.CA1710.severity = warning # CA1710: Identifiers should have correct suffix dotnet_diagnostic.CA1711.severity = warning # CA1711: Identifiers should not have incorrect suffix dotnet_diagnostic.CA1712.severity = warning # CA1712: Do not prefix enum values with type name dotnet_diagnostic.CA1725.severity = warning # CA1725: Parameter names should match base declaration dotnet_diagnostic.CA1805.severity = warning # CA1805: Do not initialize unnecessarily dotnet_diagnostic.CA1806.severity = warning # CA1806: Do not ignore method results dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations dotnet_diagnostic.CA1827.severity = warning # CA1827: Do not use Count() or LongCount() when Any() can be used dotnet_diagnostic.CA1836.severity = warning # CA1836: Prefer IsEmpty over Count dotnet_diagnostic.CA1840.severity = warning # CA1840: Use 'Environment.CurrentManagedThreadId' dotnet_diagnostic.CA1852.severity = warning # CA1852: Seal internal types dotnet_diagnostic.CA1854.severity = warning # CA1854: Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method # Disabled as it's making the code complex to deal with when multi targeting dotnet_diagnostic.CA1863.severity = none # CA1863: Use 'CompositeFormat' dotnet_diagnostic.CA2016.severity = warning # CA2016: Forward the 'CancellationToken' parameter to methods dotnet_diagnostic.CA2208.severity = warning # CA2208: Instantiate argument exceptions correctly dotnet_diagnostic.CA2211.severity = warning # CA2211: Non-constant fields should not be visible dotnet_diagnostic.CA2215.severity = warning # CA2215: Dispose methods should call base class dispose dotnet_diagnostic.CA2219.severity = warning # CA2219: Do not raise exceptions in finally clauses dotnet_diagnostic.CA2241.severity = warning # CA2241: Provide correct arguments to formatting methods dotnet_diagnostic.CA2242.severity = warning # CA2242: Test for NaN correctly dotnet_diagnostic.CA2244.severity = warning # CA2244: Do not duplicate indexed element initializations dotnet_diagnostic.CA2245.severity = warning # CA2245: Do not assign a property to itself dotnet_diagnostic.CA2248.severity = warning # CA2248: Provide correct enum argument to Enum.HasFlag dotnet_public_api_analyzer.require_api_files = true # RS0016: Only enable if API files are present dotnet_diagnostic.RS0041.severity = none # RS0041: Do not use 'Obsolete' attribute # Disabled due to bug https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3687 dotnet_diagnostic.SA1010.severity = none # SA1010: Opening square brackets should be spaced correctly dotnet_diagnostic.SA1101.severity = none # SA1101: Prefix local calls with this dotnet_diagnostic.SA1115.severity = none # SA1115: Parameter should follow comma dotnet_diagnostic.SA1117.severity = none # SA1117: Parameters should be on same line or separate lines dotnet_diagnostic.SA1118.severity = none # SA1118: Parameter should not span multiple lines dotnet_diagnostic.SA1124.severity = none # SA1124: Do not use regions dotnet_diagnostic.SA1201.severity = none # SA1201: Elements should appear in the correct order dotnet_diagnostic.SA1202.severity = none # SA1202: Elements should be ordered by access dotnet_diagnostic.SA1204.severity = none # SA1204: Static elements should appear before instance elements dotnet_diagnostic.SA1308.severity = none # SA1308: Variable names should not be prefixed dotnet_diagnostic.SA1309.severity = none # SA1309: Field names should not begin with underscore dotnet_diagnostic.SA1313.severity = none # SA1313: Parameter names should begin with lower-case letter dotnet_diagnostic.SA1402.severity = none # SA1402: File may only contain a single type dotnet_diagnostic.SA1515.severity = none # SA1515: Single-line comment should be preceded by blank line dotnet_diagnostic.SA1611.severity = none # SA1611: Element parameters should be documented dotnet_diagnostic.SA1615.severity = none # SA1615: Element return value should be documented dotnet_diagnostic.SA1649.severity = none # SA1649: File name should match first type name # ----------------------------------------------------------------------------------------- # Globally disabled but enabled for src folder dotnet_diagnostic.SA1600.severity = none # SA1600: Elements should be documented dotnet_diagnostic.SA1601.severity = none # SA1601: Partial elements should be documented # ----------------------------------------------------------------------------------------- dotnet_diagnostic.VSTHRD002.severity = none # VSTHRD002 Avoid problematic synchronous waits dotnet_diagnostic.VSTHRD003.severity = none # VSTHRD003: Avoid awaiting foreign Tasks dotnet_diagnostic.VSTHRD105.severity = none # VSTHRD105: Avoid method overloads that assume TaskScheduler.Current #### Naming styles #### ## Naming rules (define naming rule using dotnet_naming_rule..