diff --git a/.editorconfig b/.editorconfig index 8c3845c..9c1d16a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,27 @@ root = true [*] -indent_style = space -indent_size = 4 -end_of_line = lf charset = utf-8 +end_of_line = lf +ij_xml_attribute_wrap = off +ij_xml_text_wrap = off +indent_size = 4 +indent_style = space +insert_final_newline = false trim_trailing_whitespace = true +[*.cs] +dotnet_analyzer_diagnostic.severity = warning +dotnet_diagnostic.CA1707.severity = none +dotnet_diagnostic.CA5350.severity = none +dotnet_diagnostic.CA5351.severity = none +dotnet_diagnostic.IDE0008.severity = none +dotnet_diagnostic.IDE0017.severity = none +dotnet_diagnostic.IDE0048.severity = none +dotnet_diagnostic.IDE0055.severity = none +dotnet_diagnostic.IDE0058.severity = none +dotnet_diagnostic.IDE0160.severity = none + # ReSharper properties resharper_align_linq_query = true @@ -23,23 +38,27 @@ resharper_align_multline_type_parameter_constrains = true resharper_align_multline_type_parameter_list = true resharper_align_tuple_components = true resharper_allow_comment_after_lbrace = true +resharper_blank_lines_before_single_line_comment = 1 resharper_csharp_empty_block_style = together_same_line resharper_csharp_outdent_commas = true +resharper_csharp_place_type_constraints_on_same_line = false resharper_csharp_stick_comment = false resharper_csharp_wrap_before_comma = true -resharper_indent_nested_foreach_stmt = true resharper_indent_nested_for_stmt = true +resharper_indent_nested_foreach_stmt = true resharper_indent_nested_while_stmt = true resharper_indent_preprocessor_if = usual_indent resharper_indent_preprocessor_other = usual_indent resharper_int_align = true resharper_keep_existing_arrangement = false resharper_place_linq_into_on_new_line = false +resharper_place_simple_embedded_statement_on_same_line = false resharper_place_simple_switch_expression_on_single_line = true resharper_wrap_before_eq = true resharper_wrap_chained_method_calls = chop_if_long resharper_wrap_switch_expression = chop_if_long + # Microsoft .NET properties csharp_indent_braces = false csharp_new_line_before_open_brace = local_functions, methods, types \ No newline at end of file diff --git a/CodeQuality.props b/CodeQuality.props new file mode 100644 index 0000000..df0775d --- /dev/null +++ b/CodeQuality.props @@ -0,0 +1,17 @@ + + + ../StyleCopAnalyzers.ruleset + true + true + true + true + true + true + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + \ No newline at end of file diff --git a/SonarqubleAnalyzer.props b/SonarqubleAnalyzer.props deleted file mode 100644 index 43a4aff..0000000 --- a/SonarqubleAnalyzer.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - \ No newline at end of file diff --git a/StyleCopAnalyzers.ruleset b/StyleCopAnalyzers.ruleset index b0022fc..f89a00e 100644 --- a/StyleCopAnalyzers.ruleset +++ b/StyleCopAnalyzers.ruleset @@ -1,217 +1,221 @@ - + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dot.sln b/dot.sln index a06fe81..b89461e 100644 --- a/dot.sln +++ b/dot.sln @@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{AD79881E-7 build.cake = build.cake code-format.cmd = code-format.cmd CodeCleanupOnSave.csx = CodeCleanupOnSave.csx + CodeQuality.props = CodeQuality.props Directory.Build.props = Directory.Build.props dot.sln.DotSettings = dot.sln.DotSettings dot.sln.DotSettings.user = dot.sln.DotSettings.user @@ -27,7 +28,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{AD79881E-7 README.md = README.md README.zh-CN.md = README.zh-CN.md SafetyDelUnusedResx.ahk = SafetyDelUnusedResx.ahk - SonarqubleAnalyzer.props = SonarqubleAnalyzer.props + stylecop.json = stylecop.json + StyleCopAnalyzers.ruleset = StyleCopAnalyzers.ruleset switch-nuget.cmd = switch-nuget.cmd switch-project.cmd = switch-project.cmd switcher.json = switcher.json diff --git a/dot.sln.DotSettings b/dot.sln.DotSettings index ea65e11..aebd72b 100644 --- a/dot.sln.DotSettings +++ b/dot.sln.DotSettings @@ -1,6 +1,18 @@ - 1 - 1 + False + 1 + 1 + OFF + HINT + Required + Required + Required + Required + <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> + <Policy Inspect="True" Prefix="_" Suffix="" Style="AA_BB" /> + <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <?xml version="1.0" encoding="utf-16"?> <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> <TypePattern> @@ -8,43 +20,38 @@ <Entry.SortBy> <Kind> <Kind.Order> - <DeclarationKind>Interface</DeclarationKind> - <DeclarationKind>Class</DeclarationKind> - <DeclarationKind>Record</DeclarationKind> - <DeclarationKind>Enum</DeclarationKind> - <DeclarationKind>Struct</DeclarationKind> - <DeclarationKind>Delegate</DeclarationKind> - <DeclarationKind>Event</DeclarationKind> <DeclarationKind>Constant</DeclarationKind> <DeclarationKind>Field</DeclarationKind> - <DeclarationKind>Property</DeclarationKind> <DeclarationKind>Constructor</DeclarationKind> <DeclarationKind>Destructor</DeclarationKind> + <DeclarationKind>Delegate</DeclarationKind> + <DeclarationKind>Event</DeclarationKind> + <DeclarationKind>Enum</DeclarationKind> + <DeclarationKind>Interface</DeclarationKind> + <DeclarationKind>Property</DeclarationKind> <DeclarationKind>Indexer</DeclarationKind> <DeclarationKind>Method</DeclarationKind> + <DeclarationKind>Struct</DeclarationKind> + <DeclarationKind>Record</DeclarationKind> + <DeclarationKind>Class</DeclarationKind> </Kind.Order> </Kind> <Access> <Access.Order> - <AccessModifier>Private</AccessModifier> - <AccessModifier>PrivateProtected</AccessModifier> - <AccessModifier>Protected</AccessModifier> - <AccessModifier>ProtectedInternal</AccessModifier> - <AccessModifier>Internal</AccessModifier> <AccessModifier>Public</AccessModifier> + <AccessModifier>Internal</AccessModifier> + <AccessModifier>ProtectedInternal</AccessModifier> + <AccessModifier>Protected</AccessModifier> + <AccessModifier>PrivateProtected</AccessModifier> + <AccessModifier>Private</AccessModifier> </Access.Order> </Access> + <Static /> + <Readonly /> <Name /> </Entry.SortBy> </Entry> </TypePattern> </Patterns> - <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> - <Policy Inspect="True" Prefix="_" Suffix="" Style="AA_BB" /> - <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - False - HINT + \ No newline at end of file diff --git a/src/AssemblyInfo.cs b/src/AssemblyInfo.cs index 9f3ac12..21578b5 100644 --- a/src/AssemblyInfo.cs +++ b/src/AssemblyInfo.cs @@ -13,9 +13,8 @@ using Dot; namespace Dot; -public static class AssemblyInfo +internal static class AssemblyInfo { - private const string _VERSION = "1.1.6"; public const string ASSEMBLY_COMPANY = "nsnail"; public const string ASSEMBLY_COPYRIGHT = $"Copyright (c) 2022 {ASSEMBLY_COMPANY}"; public const string ASSEMBLY_FILE_VERSION = _VERSION; @@ -25,4 +24,5 @@ public static class AssemblyInfo public const string ASSEMBLY_PRODUCT = "dot"; public const string ASSEMBLY_TITLE = "功能全面的实用工具 - 程序员的瑞士军刀"; public const string ASSEMBLY_VERSION = _VERSION; + private const string _VERSION = "1.1.6"; } \ No newline at end of file diff --git a/src/Color/Main.cs b/src/Color/Main.cs index 889b509..3f5edfa 100644 --- a/src/Color/Main.cs +++ b/src/Color/Main.cs @@ -1,12 +1,13 @@ -// ReSharper disable ClassNeverInstantiated.Global - #if NET7_0_WINDOWS +using System.Runtime.InteropServices; +using System.Runtime.Versioning; + namespace Dot.Color; [Description(nameof(Str.ScreenPixelTool))] [Localization(typeof(Str))] +[SupportedOSPlatform(nameof(OSPlatform.Windows))] internal sealed class Main : ToolBase