From dfffc3384bf621df04c0259e0193a05ed05fdef7 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 6 May 2021 17:14:03 +0200 Subject: [PATCH] More code inspections! --- .editorconfig | 115 +++++++++++------- .../AssemblyInfo.cs | 24 ++++ .../AssemblyInfo.cs | 24 ++++ .../AssemblyInfo.cs | 24 ++++ ArchiSteamFarm.Tests/AssemblyInfo.cs | 2 + ArchiSteamFarm/AssemblyInfo.cs | 2 + Directory.Build.props | 2 + 7 files changed, 149 insertions(+), 44 deletions(-) create mode 100644 ArchiSteamFarm.CustomPlugins.ExamplePlugin/AssemblyInfo.cs create mode 100644 ArchiSteamFarm.CustomPlugins.PeriodicGC/AssemblyInfo.cs create mode 100644 ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/AssemblyInfo.cs diff --git a/.editorconfig b/.editorconfig index 9ffe6e131..837ae12aa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,12 @@ +root = true + ############################### # Core EditorConfig Options # ############################### -root = true - [*] charset = utf-8 -# TODO: file_header_template +file_header_template = _ _ _ ____ _ _____\n / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___\n / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \\n / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |\n/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|\n|\nCopyright 2015-$CURRENT_YEAR$ Łukasz "JustArchi" Domeradzki\nContact: JustArchi@JustArchi.net\n|\nLicensed under the Apache License, Version 2.0 (the "License");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n|\nhttp://www.apache.org/licenses/LICENSE-2.0\n|\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License. indent_style = tab insert_final_newline = true trim_trailing_whitespace = true @@ -16,53 +16,53 @@ trim_trailing_whitespace = true ############################### [*.cs] -csharp_indent_block_contents = true:warning -csharp_indent_braces = false:warning -csharp_indent_case_contents = true:warning -csharp_indent_case_contents_when_block = false:warning -csharp_indent_labels = flush_left:warning -csharp_indent_switch_labels = true:warning +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_labels = flush_left +csharp_indent_switch_labels = true -csharp_new_line_before_catch = false:warning -csharp_new_line_before_else = false:warning -csharp_new_line_before_finally = false:warning -csharp_new_line_before_members_in_anonymous_types = false:warning -csharp_new_line_before_members_in_object_initializers = false:warning -csharp_new_line_before_open_brace = none:warning -csharp_new_line_between_query_expression_clauses = false:warning +csharp_new_line_before_catch = false +csharp_new_line_before_else = false +csharp_new_line_before_finally = false +csharp_new_line_before_members_in_anonymous_types = false +csharp_new_line_before_members_in_object_initializers = false +csharp_new_line_before_open_brace = none +csharp_new_line_between_query_expression_clauses = false csharp_prefer_braces = true:warning csharp_prefer_simple_default_expression = true:warning csharp_prefer_simple_using_statement = true:warning csharp_prefer_static_local_function = true:warning -csharp_preferred_modifier_order = public,protected,internal,private,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning +csharp_preferred_modifier_order = public, protected, internal, private, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:warning -csharp_preserve_single_line_blocks = true:warning -csharp_preserve_single_line_statements = false:warning +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false -csharp_space_after_cast = true:warning -csharp_space_after_colon_in_inheritance_clause = true:warning -csharp_space_after_comma = true:warning -csharp_space_after_dot = false:warning -csharp_space_after_keywords_in_control_flow_statements = true:warning -csharp_space_after_semicolon_in_for_statement = true:warning -csharp_space_around_binary_operators = before_and_after:warning -csharp_space_around_declaration_statements = false:warning -csharp_space_before_colon_in_inheritance_clause = true:warning -csharp_space_before_comma = false:warning -csharp_space_before_dot = false:warning -csharp_space_before_open_square_brackets = false:warning -csharp_space_before_semicolon_in_for_statement = false:warning -csharp_space_between_empty_square_brackets = false:warning -csharp_space_between_method_call_empty_parameter_list_parentheses = false:warning -csharp_space_between_method_call_name_and_opening_parenthesis = false:warning -csharp_space_between_method_call_parameter_list_parentheses = false:warning -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:warning -csharp_space_between_method_declaration_name_and_open_parenthesis = false:warning -csharp_space_between_method_declaration_parameter_list_parentheses = false:warning -csharp_space_between_parentheses = none:warning -csharp_space_between_square_brackets = false:warning +csharp_space_after_cast = true +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 = false +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 = none +csharp_space_between_square_brackets = false csharp_style_conditional_delegate_call = true:warning csharp_style_deconstructed_variable_declaration = true:warning @@ -98,11 +98,38 @@ csharp_style_var_elsewhere = false:warning csharp_style_var_for_built_in_types = false:warning csharp_style_var_when_type_is_apparent = false:warning -csharp_using_directive_placement = outside_namespace:warning +csharp_using_directive_placement = outside_namespace [*.{cs,vb}] +dotnet_analyzer_diagnostic.severity = warning dotnet_code_quality_unused_parameters = all:warning +# TODO - one at a time +dotnet_diagnostic.ca1002.severity = silent +dotnet_diagnostic.ca1027.severity = silent +dotnet_diagnostic.ca1028.severity = silent +dotnet_diagnostic.ca1031.severity = silent +dotnet_diagnostic.ca1034.severity = silent +dotnet_diagnostic.ca1044.severity = silent +dotnet_diagnostic.ca1054.severity = silent +dotnet_diagnostic.ca1062.severity = silent +dotnet_diagnostic.ca1063.severity = silent +dotnet_diagnostic.ca1303.severity = silent +dotnet_diagnostic.ca1307.severity = silent +dotnet_diagnostic.ca1308.severity = silent +dotnet_diagnostic.ca1508.severity = silent +dotnet_diagnostic.ca1819.severity = silent +dotnet_diagnostic.ca1812.severity = silent +dotnet_diagnostic.ca1823.severity = silent +dotnet_diagnostic.ca2000.severity = silent +dotnet_diagnostic.ca2002.severity = silent +dotnet_diagnostic.ca3003.severity = silent +dotnet_diagnostic.ca3012.severity = silent +dotnet_diagnostic.ca3075.severity = silent +dotnet_diagnostic.ca5389.severity = silent +dotnet_diagnostic.ca5392.severity = silent +dotnet_diagnostic.ca5394.severity = silent + # Rule - almost everything dotnet_naming_rule.almost_everything_must_be_pascal_case.severity = warning dotnet_naming_rule.almost_everything_must_be_pascal_case.style = pascal_case @@ -154,8 +181,8 @@ dotnet_naming_symbols.type_parameters.applicable_kinds = type_parameter dotnet_naming_symbols.type_parameters.applicable_accessibilities = * dotnet_remove_unnecessary_suppression_exclusions = none:warning -dotnet_separate_import_directive_groups = false:warning -dotnet_sort_system_directives_first = true:warning +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true dotnet_style_coalesce_expression = true:warning dotnet_style_collection_initializer = true:warning diff --git a/ArchiSteamFarm.CustomPlugins.ExamplePlugin/AssemblyInfo.cs b/ArchiSteamFarm.CustomPlugins.ExamplePlugin/AssemblyInfo.cs new file mode 100644 index 000000000..8b02791f1 --- /dev/null +++ b/ArchiSteamFarm.CustomPlugins.ExamplePlugin/AssemblyInfo.cs @@ -0,0 +1,24 @@ +// _ _ _ ____ _ _____ +// / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___ +// / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \ +// / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | | +// /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_| +// | +// Copyright 2015-2021 Łukasz "JustArchi" Domeradzki +// Contact: JustArchi@JustArchi.net +// | +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// | +// http://www.apache.org/licenses/LICENSE-2.0 +// | +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +[assembly: CLSCompliant(false)] diff --git a/ArchiSteamFarm.CustomPlugins.PeriodicGC/AssemblyInfo.cs b/ArchiSteamFarm.CustomPlugins.PeriodicGC/AssemblyInfo.cs new file mode 100644 index 000000000..8b02791f1 --- /dev/null +++ b/ArchiSteamFarm.CustomPlugins.PeriodicGC/AssemblyInfo.cs @@ -0,0 +1,24 @@ +// _ _ _ ____ _ _____ +// / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___ +// / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \ +// / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | | +// /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_| +// | +// Copyright 2015-2021 Łukasz "JustArchi" Domeradzki +// Contact: JustArchi@JustArchi.net +// | +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// | +// http://www.apache.org/licenses/LICENSE-2.0 +// | +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +[assembly: CLSCompliant(false)] diff --git a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/AssemblyInfo.cs b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/AssemblyInfo.cs new file mode 100644 index 000000000..8b02791f1 --- /dev/null +++ b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/AssemblyInfo.cs @@ -0,0 +1,24 @@ +// _ _ _ ____ _ _____ +// / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___ +// / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \ +// / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | | +// /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_| +// | +// Copyright 2015-2021 Łukasz "JustArchi" Domeradzki +// Contact: JustArchi@JustArchi.net +// | +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// | +// http://www.apache.org/licenses/LICENSE-2.0 +// | +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +[assembly: CLSCompliant(false)] diff --git a/ArchiSteamFarm.Tests/AssemblyInfo.cs b/ArchiSteamFarm.Tests/AssemblyInfo.cs index 3aff112cd..aefed18a1 100644 --- a/ArchiSteamFarm.Tests/AssemblyInfo.cs +++ b/ArchiSteamFarm.Tests/AssemblyInfo.cs @@ -19,6 +19,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +using System; using Microsoft.VisualStudio.TestTools.UnitTesting; +[assembly: CLSCompliant(false)] [assembly: Parallelize(Scope = ExecutionScope.MethodLevel)] diff --git a/ArchiSteamFarm/AssemblyInfo.cs b/ArchiSteamFarm/AssemblyInfo.cs index ed8d8005e..077b552ce 100644 --- a/ArchiSteamFarm/AssemblyInfo.cs +++ b/ArchiSteamFarm/AssemblyInfo.cs @@ -19,7 +19,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +using System; using System.Runtime.CompilerServices; +[assembly: CLSCompliant(false)] [assembly: InternalsVisibleTo("ArchiSteamFarm.Tests")] [assembly: InternalsVisibleTo("ArchiSteamFarm.OfficialPlugins.SteamTokenDumper")] diff --git a/Directory.Build.props b/Directory.Build.props index a918d8501..262ec52be 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,6 +4,7 @@ + AllEnabledByDefault ../resources/ASF.ico JustArchi JustArchiNET @@ -13,6 +14,7 @@ none latest true + en 1591 enable ../resources/ASF.ico