diff --git a/.editorconfig b/.editorconfig index 33fd057..3d4c01b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ -# Version: 2.1.0 (Using https://semver.org/) -# Updated: 2021-03-03 +# 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. @@ -49,11 +49,11 @@ indent_size = 2 indent_size = 2 # Markdown Files -[*.md] +[*.{md,mdx}] trim_trailing_whitespace = false # Web Files -[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,svg,vue}] +[*.{htm,html,js,jsm,ts,tsx,cjs,cts,ctsx,mjs,mts,mtsx,css,sass,scss,less,pcss,svg,vue}] indent_size = 2 # Batch Files @@ -75,7 +75,7 @@ indent_style = tab [*.{cs,csx,cake,vb,vbx}] # Default Severity for all .NET Code Style rules below -dotnet_analyzer_diagnostic.category-style.severity = warning +dotnet_analyzer_diagnostic.severity = warning ########################################## # Language Rules @@ -122,13 +122,13 @@ 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 (c) Six Labors.\nLicensed under the Apache License, Version 2.0. +file_header_template = Copyright (c) Six Labors.\nLicensed under the Six Labors Split License. # SA1636: File header copyright text should match # Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project. # dotnet_diagnostic.SA1636.severity = none - # Undocumented -dotnet_style_operator_placement_when_wrapping = end_of_line +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 @@ -200,12 +200,15 @@ dotnet_diagnostic.IDE0059.severity = suggestion # 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/visualstudio/ide/editorconfig-formatting-conventions#new-line-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 @@ -214,7 +217,7 @@ 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/visualstudio/ide/editorconfig-formatting-conventions#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 @@ -222,7 +225,7 @@ csharp_indent_block_contents = true csharp_indent_braces = false csharp_indent_case_contents_when_block = false # Spacing options -# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#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 @@ -246,9 +249,12 @@ 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/visualstudio/ide/editorconfig-formatting-conventions#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 @@ -275,9 +281,8 @@ dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization = pascal_ 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 -# Disabled while we investigate compatibility with VS 16.10 -#dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____ -#dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____ +dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____ +dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____ # internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file dotnet_naming_style.internal_error_style.capitalization = pascal_case dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____ diff --git a/msbuild/props/SixLabors.Global.props b/msbuild/props/SixLabors.Global.props index 4b8e99f..6dc1c1c 100644 --- a/msbuild/props/SixLabors.Global.props +++ b/msbuild/props/SixLabors.Global.props @@ -12,7 +12,7 @@ @@ -62,7 +62,7 @@ - 9.0 + 10.0 true strict;IOperation true diff --git a/sixlabors.ruleset b/sixlabors.ruleset index 8420805..14c6e98 100644 --- a/sixlabors.ruleset +++ b/sixlabors.ruleset @@ -1,9 +1,5 @@  - - - - - + diff --git a/sixlabors.tests.ruleset b/sixlabors.tests.ruleset index 72f4eff..da6e749 100644 --- a/sixlabors.tests.ruleset +++ b/sixlabors.tests.ruleset @@ -1,5 +1,5 @@  - + diff --git a/stylecop.json b/stylecop.json index f134b31..0cdd13c 100644 --- a/stylecop.json +++ b/stylecop.json @@ -10,7 +10,7 @@ "documentationRules": { "xmlHeader": false, "documentInternalElements": false, - "copyrightText": "Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2.0." + "copyrightText": "Copyright (c) Six Labors.\nLicensed under the Six Labors Split License." } } }