From a23d36f7deca165795435913a1faca52b62d15c4 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Thu, 31 Oct 2024 20:03:15 +0100 Subject: [PATCH 1/8] TEST-0008 Update packages --- src/backend/WebApi/WebApi.csproj | 1 + src/backend/WebApi/packages.lock.json | 6 ++++++ tests/backend/WebApi.Tests/packages.lock.json | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/backend/WebApi/WebApi.csproj b/src/backend/WebApi/WebApi.csproj index ac6234d..6918852 100644 --- a/src/backend/WebApi/WebApi.csproj +++ b/src/backend/WebApi/WebApi.csproj @@ -17,6 +17,7 @@ + diff --git a/src/backend/WebApi/packages.lock.json b/src/backend/WebApi/packages.lock.json index 900def0..a76b22f 100644 --- a/src/backend/WebApi/packages.lock.json +++ b/src/backend/WebApi/packages.lock.json @@ -40,6 +40,12 @@ "resolved": "1.21.0", "contentHash": "8NudeHOE56YsY59HYY89akRMup8Ho+7Y3cADTGjajjWroXVU9RQai2nA6PfteB8AuzmRHZ5NZQB2BnWhQEul5g==" }, + "nuget_distribution_example": { + "type": "Direct", + "requested": "[0.0.1, )", + "resolved": "0.0.1", + "contentHash": "+bcU6c2irx9dnY54EhLWKn8k1nKUtXiPXXondLnLC9A2ob1FPYX5bXHl1cNQ+ch6KPF7riwh+6lNoRWwGZAxaA==" + }, "OpenTelemetry.Exporter.Console": { "type": "Direct", "requested": "[1.9.0, )", diff --git a/tests/backend/WebApi.Tests/packages.lock.json b/tests/backend/WebApi.Tests/packages.lock.json index b377daf..76f5ad9 100644 --- a/tests/backend/WebApi.Tests/packages.lock.json +++ b/tests/backend/WebApi.Tests/packages.lock.json @@ -683,6 +683,11 @@ "resolved": "13.0.1", "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" }, + "nuget_distribution_example": { + "type": "Transitive", + "resolved": "0.0.1", + "contentHash": "+bcU6c2irx9dnY54EhLWKn8k1nKUtXiPXXondLnLC9A2ob1FPYX5bXHl1cNQ+ch6KPF7riwh+6lNoRWwGZAxaA==" + }, "OpenTelemetry": { "type": "Transitive", "resolved": "1.9.0", @@ -1050,7 +1055,8 @@ "OpenTelemetry.Instrumentation.Runtime": "[1.9.0, )", "RabbitMQ.Client": "[6.8.1, )", "Swashbuckle.AspNetCore": "[6.9.0, )", - "Swashbuckle.AspNetCore.ReDoc": "[6.9.0, )" + "Swashbuckle.AspNetCore.ReDoc": "[6.9.0, )", + "nuget_distribution_example": "[0.0.1, )" } } }, From 911b6285fdf24602fea7abe25cb07776e986ecbc Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Thu, 31 Oct 2024 23:16:20 +0100 Subject: [PATCH 2/8] TEST-0008 Add nuget dist project --- shared/NugetDistSample/NugetDistSample.csproj | 32 +++ .../NugetDistSample.nuspec-temp | 17 ++ shared/NugetDistSample/Program.cs | 2 + .../build/nuget_distribution_example.props | 9 + .../build/nuget_distribution_example.targets | 2 + shared/NugetDistSample/content/.editorconfig | 232 ++++++++++++++++++ shared/NugetDistSample/packages.lock.json | 6 + shared/NugetDistSample/readme.md | Bin 0 -> 288 bytes src/backend/Backend.sln | 8 + 9 files changed, 308 insertions(+) create mode 100644 shared/NugetDistSample/NugetDistSample.csproj create mode 100644 shared/NugetDistSample/NugetDistSample.nuspec-temp create mode 100644 shared/NugetDistSample/Program.cs create mode 100644 shared/NugetDistSample/build/nuget_distribution_example.props create mode 100644 shared/NugetDistSample/build/nuget_distribution_example.targets create mode 100644 shared/NugetDistSample/content/.editorconfig create mode 100644 shared/NugetDistSample/packages.lock.json create mode 100644 shared/NugetDistSample/readme.md diff --git a/shared/NugetDistSample/NugetDistSample.csproj b/shared/NugetDistSample/NugetDistSample.csproj new file mode 100644 index 0000000..d642a8d --- /dev/null +++ b/shared/NugetDistSample/NugetDistSample.csproj @@ -0,0 +1,32 @@ + + + + Exe + net8.0 + enable + enable + nuget_distribution_example + 0.0.7 + Hans Christian Winther-Sørensen + WSH + Distributing shared project files example + Nuget distribution example + Nuget distribution example + git + https://github.com/hwinther/test + readme.md + + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/shared/NugetDistSample/NugetDistSample.nuspec-temp b/shared/NugetDistSample/NugetDistSample.nuspec-temp new file mode 100644 index 0000000..f87d448 --- /dev/null +++ b/shared/NugetDistSample/NugetDistSample.nuspec-temp @@ -0,0 +1,17 @@ + + + + $id$ + $version$ + $title$ + $description$ + $authors$ + $copyright$ + false + MIT + + + + + + \ No newline at end of file diff --git a/shared/NugetDistSample/Program.cs b/shared/NugetDistSample/Program.cs new file mode 100644 index 0000000..3751555 --- /dev/null +++ b/shared/NugetDistSample/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/shared/NugetDistSample/build/nuget_distribution_example.props b/shared/NugetDistSample/build/nuget_distribution_example.props new file mode 100644 index 0000000..ddb251f --- /dev/null +++ b/shared/NugetDistSample/build/nuget_distribution_example.props @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/shared/NugetDistSample/build/nuget_distribution_example.targets b/shared/NugetDistSample/build/nuget_distribution_example.targets new file mode 100644 index 0000000..551819f --- /dev/null +++ b/shared/NugetDistSample/build/nuget_distribution_example.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/shared/NugetDistSample/content/.editorconfig b/shared/NugetDistSample/content/.editorconfig new file mode 100644 index 0000000..875356e --- /dev/null +++ b/shared/NugetDistSample/content/.editorconfig @@ -0,0 +1,232 @@ +# Remove the line below if you want to inherit .editorconfig settings from higher directories +root = true + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +end_of_line = crlf +insert_final_newline = false + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = false +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false +dotnet_style_qualification_for_property = false + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true +dotnet_style_predefined_type_for_member_access = true + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_operators = never_if_unnecessary +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_style_coalesce_expression = true +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true +dotnet_style_prefer_collection_expression = when_types_loosely_match +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = true +dotnet_style_prefer_conditional_expression_over_return = true +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true + +# Parameter preferences +dotnet_code_quality_unused_parameters = all + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = true +dotnet_style_allow_statement_immediately_after_block_experimental = true + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = false +csharp_style_var_for_built_in_types = false +csharp_style_var_when_type_is_apparent = false + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true +csharp_style_expression_bodied_constructors = false +csharp_style_expression_bodied_indexers = true +csharp_style_expression_bodied_lambdas = true +csharp_style_expression_bodied_local_functions = false +csharp_style_expression_bodied_methods = false +csharp_style_expression_bodied_operators = false +csharp_style_expression_bodied_properties = true + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true +csharp_style_pattern_matching_over_is_with_cast_check = true +csharp_style_prefer_extended_property_pattern = true +csharp_style_prefer_not_pattern = true +csharp_style_prefer_pattern_matching = true +csharp_style_prefer_switch_expression = true + +# Null-checking preferences +csharp_style_conditional_delegate_call = true + +# Modifier preferences +csharp_prefer_static_anonymous_function = true +csharp_prefer_static_local_function = true +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async +csharp_style_prefer_readonly_struct = true +csharp_style_prefer_readonly_struct_member = true + +# Code-block preferences +csharp_prefer_braces = true +csharp_prefer_simple_using_statement = true +csharp_style_namespace_declarations = block_scoped +csharp_style_prefer_method_group_conversion = true +csharp_style_prefer_primary_constructors = true +csharp_style_prefer_top_level_statements = true + +# Expression-level preferences +csharp_prefer_simple_default_expression = true +csharp_style_deconstructed_variable_declaration = true +csharp_style_implicit_object_creation_when_type_is_apparent = true +csharp_style_inlined_variable_declaration = true +csharp_style_prefer_index_operator = true +csharp_style_prefer_local_over_anonymous_function = true +csharp_style_prefer_null_check_over_type_check = true +csharp_style_prefer_range_operator = true +csharp_style_prefer_tuple_swap = true +csharp_style_prefer_utf8_string_literals = true +csharp_style_throw_expression = true +csharp_style_unused_value_assignment_preference = discard_variable +csharp_style_unused_value_expression_statement_preference = discard_variable + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace + +# New line preferences +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true +csharp_style_allow_embedded_statements_on_same_line_experimental = true + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +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_case_contents_when_block = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +# 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 = 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 = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case diff --git a/shared/NugetDistSample/packages.lock.json b/shared/NugetDistSample/packages.lock.json new file mode 100644 index 0000000..807ab82 --- /dev/null +++ b/shared/NugetDistSample/packages.lock.json @@ -0,0 +1,6 @@ +{ + "version": 1, + "dependencies": { + "net8.0": {} + } +} \ No newline at end of file diff --git a/shared/NugetDistSample/readme.md b/shared/NugetDistSample/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..0a1d02c7835bf3aa0e435c27dcac62b8eb16fcb8 GIT binary patch literal 288 zcmchR$qm9l3`O4=i5@I*rwclufk46{mWeV!qI%$Y#DxYpjQz)dvEQ#1!G2}f T;#<=dDt@mjIy3Qq_pSK= Date: Thu, 31 Oct 2024 23:24:13 +0100 Subject: [PATCH 3/8] TEST-0008 Fix duplicate file --- shared/NugetDistSample/NugetDistSample.csproj | 5 +++-- .../NugetDistSample/build/nuget_distribution_example.props | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/shared/NugetDistSample/NugetDistSample.csproj b/shared/NugetDistSample/NugetDistSample.csproj index d642a8d..1090ba7 100644 --- a/shared/NugetDistSample/NugetDistSample.csproj +++ b/shared/NugetDistSample/NugetDistSample.csproj @@ -6,7 +6,7 @@ enable enable nuget_distribution_example - 0.0.7 + 0.0.9 Hans Christian Winther-Sørensen WSH Distributing shared project files example @@ -26,7 +26,8 @@ - + + \ No newline at end of file diff --git a/shared/NugetDistSample/build/nuget_distribution_example.props b/shared/NugetDistSample/build/nuget_distribution_example.props index ddb251f..057e873 100644 --- a/shared/NugetDistSample/build/nuget_distribution_example.props +++ b/shared/NugetDistSample/build/nuget_distribution_example.props @@ -1,9 +1,10 @@  - + + - + \ No newline at end of file From e5ae9b154f1544731483f399d8c85d22e4357928 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Fri, 1 Nov 2024 23:51:31 +0100 Subject: [PATCH 4/8] TEST-0008 Add tool for various tasks and package release script --- shared/NugetDistSample/NugetDistSample.csproj | 12 +- shared/NugetDistSample/Program.cs | 143 +++++++++++++++++- .../build/nuget_distribution_example.props | 5 +- shared/NugetDistSample/release.ps1 | 33 ++++ 4 files changed, 180 insertions(+), 13 deletions(-) create mode 100644 shared/NugetDistSample/release.ps1 diff --git a/shared/NugetDistSample/NugetDistSample.csproj b/shared/NugetDistSample/NugetDistSample.csproj index 1090ba7..6c15b9f 100644 --- a/shared/NugetDistSample/NugetDistSample.csproj +++ b/shared/NugetDistSample/NugetDistSample.csproj @@ -1,12 +1,11 @@ - - + Exe net8.0 enable enable nuget_distribution_example - 0.0.9 + 0.0.22 Hans Christian Winther-Sørensen WSH Distributing shared project files example @@ -15,19 +14,14 @@ git https://github.com/hwinther/test readme.md - true true - - - - + - \ No newline at end of file diff --git a/shared/NugetDistSample/Program.cs b/shared/NugetDistSample/Program.cs index 3751555..ca3a0df 100644 --- a/shared/NugetDistSample/Program.cs +++ b/shared/NugetDistSample/Program.cs @@ -1,2 +1,141 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using System.Diagnostics; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Text.RegularExpressions; + +if (args.Length == 2) +{ + var msbuildDir = args[0]; + var solutionDir = args[1]; + Console.WriteLine($"MsbuildDir: {msbuildDir}"); + Console.WriteLine($"SolutionDir: {solutionDir}"); + + var solutionSignature = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(solutionDir)); + var cachePath = Path.Combine(msbuildDir, "..", $"cached-run-{solutionSignature}"); + if (Path.Exists(cachePath)) + { + Console.WriteLine("Already executed for this solution."); + return; + } + + var gitFolderPath = FindGitFolder(solutionDir); + if (gitFolderPath == null) + { + Console.WriteLine(".git folder not found."); + return; + } + + Console.WriteLine($".git folder found at: {gitFolderPath}"); + + var gitIgnorePath = Path.Combine(gitFolderPath, ".gitignore"); + AddGitIgnoreLineRegex(gitIgnorePath, "**/.idea/**", IdeaRegex()); + + RecursivelyCopyContent(Path.Combine(msbuildDir, "..", "content"), gitFolderPath); + + var hooksAdded = ExecuteCommandIfLineDoesNotExist(Path.Combine(gitFolderPath, ".git", "config"), "hooksPath = .githooks", "git config --local core.hooksPath .githooks"); + Console.WriteLine(hooksAdded ? "Git hooks path set." : "Git hooks path already set."); + + File.WriteAllText(cachePath, DateTime.Now.ToString(CultureInfo.InvariantCulture)); +} +else +{ + Console.WriteLine("Usage: NugetDistSample "); +} + +return; + +static string? FindGitFolder(string? directory) +{ + while (!string.IsNullOrEmpty(directory)) + { + if (Directory.Exists(Path.Combine(directory, ".git"))) + return directory; + + directory = Directory.GetParent(directory) + ?.FullName; + } + + return null; +} + +static bool ExecuteCommandIfLineDoesNotExist(string filePath, string line, string command) +{ + var lines = File.ReadAllLines(filePath); + if (lines.Contains(line)) + return false; + + Console.WriteLine($"Executing: {command}"); + + ProcessStartInfo processStartInfo = new() + { + WorkingDirectory = Path.GetDirectoryName(filePath), + UseShellExecute = false, + CreateNoWindow = true + }; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + processStartInfo.FileName = "cmd"; + processStartInfo.Arguments = $"/c {command}"; + } + else + { + processStartInfo.FileName = "sh"; + processStartInfo.Arguments = $"-c \"{command}\""; + } + + var process = Process.Start(processStartInfo); + + if (process == null) + return false; + + if (process.WaitForExit(5000)) + return true; + + Console.WriteLine("Timeout waiting for process to exit."); + process.Kill(true); + return false; +} + +static void AddGitIgnoreLineRegex(string gitIgnorePath, string line, Regex match) +{ + var lines = File.ReadAllLines(gitIgnorePath); + if (Array.Exists(lines, match.IsMatch)) + return; + + Console.WriteLine($"Adding line to .gitignore: {line}"); + File.AppendAllLines(gitIgnorePath, + new[] + { + line + }); +} + +static void RecursivelyCopyContent(string sourceFolder, string destinationFolder) +{ + foreach (var sourceSubFolder in Directory.GetDirectories(sourceFolder)) + { + var destinationSubFolder = Path.Combine(destinationFolder, Path.GetFileName(sourceSubFolder)); + if (!Directory.Exists(destinationSubFolder)) + { + Console.WriteLine($"Creating directory: {destinationSubFolder}"); + Directory.CreateDirectory(destinationSubFolder); + } + + RecursivelyCopyContent(sourceSubFolder, destinationSubFolder); + } + + foreach (var sourceFile in Directory.GetFiles(sourceFolder)) + { + var destinationFile = Path.Combine(destinationFolder, Path.GetFileName(sourceFile)); + + Console.WriteLine($"Copying file: {sourceFile} -> {destinationFile}"); + File.Copy(sourceFile, destinationFile, true); + } +} + +internal partial class Program +{ + [GeneratedRegex(@".*\.idea.*")] + private static partial Regex IdeaRegex(); +} \ No newline at end of file diff --git a/shared/NugetDistSample/build/nuget_distribution_example.props b/shared/NugetDistSample/build/nuget_distribution_example.props index 057e873..d385c1a 100644 --- a/shared/NugetDistSample/build/nuget_distribution_example.props +++ b/shared/NugetDistSample/build/nuget_distribution_example.props @@ -1,10 +1,11 @@  - + + \ No newline at end of file diff --git a/shared/NugetDistSample/release.ps1 b/shared/NugetDistSample/release.ps1 new file mode 100644 index 0000000..b33f51d --- /dev/null +++ b/shared/NugetDistSample/release.ps1 @@ -0,0 +1,33 @@ +dotnet clean -c Release .\NugetDistSample.csproj + +# Read the .csproj file +$filePath = Resolve-Path ".\NugetDistSample.csproj" +$csproj=New-Object XML +$csproj.Load($filePath) + +# Find the element +$versionElement = $csproj.Project.PropertyGroup.Version + +if ($versionElement -ne $null) { + # Split the version number into its components + $versionParts = $versionElement.Split('.') + if ($versionParts.Length -eq 3) { + # Increment the patch version + $versionParts[2] = [int]$versionParts[2] + 1 + # Join the version parts back together + $newVersion = "$($versionParts[0]).$($versionParts[1]).$($versionParts[2])" + # Update the element + $csproj.Project.PropertyGroup.Version = $newVersion + # Save the updated .csproj file + $csproj.Save($filePath) + Write-Output "Version updated to $newVersion" + } else { + Write-Error "Version format is not valid. Expected format: x.y.z" + } +} else { + Write-Error " element not found in the .csproj file." +} + +dotnet build -c Release .\NugetDistSample.csproj +dotnet pack -c Release .\NugetDistSample.csproj +dotnet nuget push .\bin\Release\nuget_distribution_example.*.nupkg --api-key $Env:GITHUB_API_KEY --source github --skip-duplicate From 99a9bc11c99ccf14400725a8349da635efd0080d Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Fri, 1 Nov 2024 23:57:24 +0100 Subject: [PATCH 5/8] TEST-0008 Update package --- shared/NugetDistSample/NugetDistSample.csproj | 2 +- src/backend/WebApi/WebApi.csproj | 4 ++-- src/backend/WebApi/packages.lock.json | 6 +++--- tests/backend/WebApi.Tests/packages.lock.json | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/shared/NugetDistSample/NugetDistSample.csproj b/shared/NugetDistSample/NugetDistSample.csproj index 6c15b9f..af942a7 100644 --- a/shared/NugetDistSample/NugetDistSample.csproj +++ b/shared/NugetDistSample/NugetDistSample.csproj @@ -5,7 +5,7 @@ enable enable nuget_distribution_example - 0.0.22 + 0.0.23 Hans Christian Winther-Sørensen WSH Distributing shared project files example diff --git a/src/backend/WebApi/WebApi.csproj b/src/backend/WebApi/WebApi.csproj index 6918852..d9feed8 100644 --- a/src/backend/WebApi/WebApi.csproj +++ b/src/backend/WebApi/WebApi.csproj @@ -17,7 +17,7 @@ - + @@ -48,4 +48,4 @@ - + \ No newline at end of file diff --git a/src/backend/WebApi/packages.lock.json b/src/backend/WebApi/packages.lock.json index a76b22f..52d400f 100644 --- a/src/backend/WebApi/packages.lock.json +++ b/src/backend/WebApi/packages.lock.json @@ -42,9 +42,9 @@ }, "nuget_distribution_example": { "type": "Direct", - "requested": "[0.0.1, )", - "resolved": "0.0.1", - "contentHash": "+bcU6c2irx9dnY54EhLWKn8k1nKUtXiPXXondLnLC9A2ob1FPYX5bXHl1cNQ+ch6KPF7riwh+6lNoRWwGZAxaA==" + "requested": "[0.0.23, )", + "resolved": "0.0.23", + "contentHash": "zX4Kz16jvf8rCg16KZg4tmFuXfrsJXEV5w5uTHHJNLLiUASCwPtF6eSbwrRMgL0HFBFwOPfXvZkjLO5mZy/ifQ==" }, "OpenTelemetry.Exporter.Console": { "type": "Direct", diff --git a/tests/backend/WebApi.Tests/packages.lock.json b/tests/backend/WebApi.Tests/packages.lock.json index 76f5ad9..5a17127 100644 --- a/tests/backend/WebApi.Tests/packages.lock.json +++ b/tests/backend/WebApi.Tests/packages.lock.json @@ -685,8 +685,8 @@ }, "nuget_distribution_example": { "type": "Transitive", - "resolved": "0.0.1", - "contentHash": "+bcU6c2irx9dnY54EhLWKn8k1nKUtXiPXXondLnLC9A2ob1FPYX5bXHl1cNQ+ch6KPF7riwh+6lNoRWwGZAxaA==" + "resolved": "0.0.23", + "contentHash": "zX4Kz16jvf8rCg16KZg4tmFuXfrsJXEV5w5uTHHJNLLiUASCwPtF6eSbwrRMgL0HFBFwOPfXvZkjLO5mZy/ifQ==" }, "OpenTelemetry": { "type": "Transitive", @@ -1056,7 +1056,7 @@ "RabbitMQ.Client": "[6.8.1, )", "Swashbuckle.AspNetCore": "[6.9.0, )", "Swashbuckle.AspNetCore.ReDoc": "[6.9.0, )", - "nuget_distribution_example": "[0.0.1, )" + "nuget_distribution_example": "[0.0.23, )" } } }, From 8a8b78643b69d6100aa33d008ccb46302a6053c7 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 2 Nov 2024 00:26:42 +0100 Subject: [PATCH 6/8] TEST-0008 Fix file check and update code format --- .editorconfig | 152 +++++++ shared/NugetDistSample/NugetDistSample.csproj | 2 +- shared/NugetDistSample/Program.cs | 4 +- shared/NugetDistSample/content/.editorconfig | 374 +++++++----------- src/backend/WebApi/WebApi.csproj | 2 +- src/backend/WebApi/packages.lock.json | 6 +- tests/backend/WebApi.Tests/packages.lock.json | 6 +- 7 files changed, 309 insertions(+), 237 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7b92ea1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,152 @@ + +[*.{blockshader,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cshtml,cu,cuh,cxx,cxxm,fx,fxh,h,h++,hh,hlsl,hlsli,hlslinc,hp,hpp,htm,html,hxx,icc,inc,inl,ino,ipp,ixx,mpp,mq4,mq5,mqh,mxx,razor,shaderFoundry,tcc,tpp,urtshader,usf,ush}] +indent_style = tab +indent_size = tab +tab_width = 4 + +[*.{asax,ascx,aspx,axaml,cs,master,paml,skin,vb,xaml,xamlx,xoml}] +indent_style = space +indent_size = 4 +tab_width = 4 + +[*.{appxmanifest,axml,build,config,csproj,dbml,discomap,dtd,jsproj,lsproj,njsproj,nuspec,proj,props,resw,resx,StyleCop,targets,tasks,vbproj,xml,xsd}] +indent_style = space +indent_size = 2 +tab_width = 2 + +[*] + +# Microsoft .NET properties +csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion +csharp_space_after_cast = true +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_var_elsewhere = true:suggestion +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion +dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion +dotnet_style_qualification_for_event = false:suggestion +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion + +# ReSharper properties +resharper_align_linq_query = true +resharper_align_multiline_argument = true +resharper_align_multiline_calls_chain = true +resharper_align_multiline_extends_list = true +resharper_align_multiline_for_stmt = true +resharper_align_multiline_parameter = true +resharper_align_multiple_declaration = true +resharper_align_multline_type_parameter_constrains = true +resharper_align_tuple_components = true +resharper_apply_on_completion = true +resharper_blank_lines_after_multiline_statements = 1 +resharper_blank_lines_around_auto_property = 0 +resharper_blank_lines_around_property = 0 +resharper_braces_for_for = required_for_multiline +resharper_braces_for_foreach = required_for_multiline +resharper_braces_for_while = required +resharper_constructor_or_destructor_body = expression_body +resharper_csharp_blank_lines_around_field = 0 +resharper_csharp_blank_lines_around_invocable = 0 +resharper_csharp_keep_blank_lines_in_code = 1 +resharper_csharp_keep_blank_lines_in_declarations = 1 +resharper_csharp_max_line_length = 250 +resharper_csharp_outdent_commas = true +resharper_csharp_wrap_arguments_style = chop_if_long +resharper_csharp_wrap_multiple_type_parameter_constraints_style = wrap_if_long +resharper_indent_nested_fixed_stmt = true +resharper_indent_nested_foreach_stmt = true +resharper_indent_nested_for_stmt = true +resharper_indent_nested_lock_stmt = true +resharper_indent_nested_usings_stmt = true +resharper_indent_nested_while_stmt = true +resharper_keep_existing_declaration_parens_arrangement = false +resharper_keep_existing_expr_member_arrangement = false +resharper_keep_existing_initializer_arrangement = false +resharper_local_function_body = expression_body +resharper_max_attribute_length_for_same_line = 50 +resharper_max_initializer_elements_on_line = 1 +resharper_method_or_operator_body = expression_body +resharper_new_line_before_while = true +resharper_place_accessorholder_attribute_on_same_line = false +resharper_place_accessor_attribute_on_same_line = false +resharper_place_field_attribute_on_same_line = false +resharper_place_simple_accessorholder_on_single_line = true +resharper_place_simple_accessor_on_single_line = false +resharper_place_simple_embedded_statement_on_same_line = false +resharper_place_simple_initializer_on_single_line = false +resharper_place_simple_property_pattern_on_single_line = false +resharper_qualified_using_at_nested_scope = true +resharper_space_within_single_line_array_initializer_braces = false +resharper_wrap_array_initializer_style = chop_if_long +resharper_wrap_chained_method_calls = chop_always +resharper_wrap_enum_declaration = chop_if_long +resharper_wrap_linq_expressions = chop_always + +# ReSharper inspection severities +resharper_annotate_can_be_null_parameter_highlighting = warning +resharper_annotate_can_be_null_type_member_highlighting = warning +resharper_annotate_not_null_parameter_highlighting = warning +resharper_annotate_not_null_type_member_highlighting = warning +resharper_arrange_constructor_or_destructor_body_highlighting = hint +resharper_arrange_local_function_body_highlighting = hint +resharper_arrange_method_or_operator_body_highlighting = hint +resharper_arrange_missing_parentheses_highlighting = hint +resharper_arrange_redundant_parentheses_highlighting = hint +resharper_arrange_this_qualifier_highlighting = hint +resharper_arrange_type_member_modifiers_highlighting = hint +resharper_arrange_type_modifiers_highlighting = hint +resharper_async_void_method_highlighting = warning +resharper_bad_control_braces_indent_highlighting = warning +resharper_bad_declaration_braces_indent_highlighting = warning +resharper_bad_expression_braces_indent_highlighting = warning +resharper_bad_indent_highlighting = warning +resharper_bad_namespace_braces_indent_highlighting = warning +resharper_bad_preprocessor_indent_highlighting = warning +resharper_bad_switch_braces_indent_highlighting = warning +resharper_built_in_type_reference_style_for_member_access_highlighting = hint +resharper_built_in_type_reference_style_highlighting = hint +resharper_cpp_bad_child_statement_indent_highlighting = warning +resharper_cpp_bad_control_braces_indent_highlighting = warning +resharper_cpp_bad_declaration_braces_indent_highlighting = warning +resharper_cpp_bad_expression_braces_indent_highlighting = warning +resharper_cpp_bad_indent_highlighting = warning +resharper_cpp_bad_namespace_braces_indent_highlighting = warning +resharper_cpp_bad_switch_braces_indent_highlighting = warning +resharper_cpp_incorrect_blank_lines_near_braces_highlighting = warning +resharper_cpp_missing_blank_lines_highlighting = warning +resharper_cpp_missing_indent_highlighting = warning +resharper_cpp_outdent_is_off_prev_level_highlighting = warning +resharper_cpp_redundant_blank_lines_highlighting = warning +resharper_cpp_tabs_and_spaces_mismatch_highlighting = warning +resharper_cpp_wrong_indent_size_highlighting = warning +resharper_empty_general_catch_clause_highlighting = error +resharper_function_complexity_overflow_highlighting = error +resharper_incorrect_blank_lines_near_braces_highlighting = warning +resharper_lambda_expression_can_be_made_static_highlighting = error +resharper_lambda_expression_must_be_static_highlighting = warning +resharper_loop_can_be_partly_converted_to_query_highlighting = hint +resharper_markup_attribute_typo_highlighting = none +resharper_markup_text_typo_highlighting = none +resharper_missing_blank_lines_highlighting = warning +resharper_missing_indent_highlighting = warning +resharper_nullable_warning_suppression_is_used_highlighting = warning +resharper_outdent_is_off_prev_level_highlighting = warning +resharper_possible_null_reference_exception_highlighting = error +resharper_redundant_base_qualifier_highlighting = warning +resharper_redundant_blank_lines_highlighting = warning +resharper_suggest_var_or_type_built_in_types_highlighting = hint +resharper_suggest_var_or_type_elsewhere_highlighting = hint +resharper_suggest_var_or_type_simple_types_highlighting = hint +resharper_tabs_and_spaces_mismatch_highlighting = warning +resharper_use_configure_await_false_for_async_disposable_highlighting = warning +resharper_use_nameof_expression_for_part_of_the_string_highlighting = warning +resharper_use_positional_deconstruction_pattern_highlighting = hint +resharper_use_throw_if_null_method_highlighting = warning +resharper_wrong_indent_size_highlighting = warning diff --git a/shared/NugetDistSample/NugetDistSample.csproj b/shared/NugetDistSample/NugetDistSample.csproj index af942a7..aadaf83 100644 --- a/shared/NugetDistSample/NugetDistSample.csproj +++ b/shared/NugetDistSample/NugetDistSample.csproj @@ -5,7 +5,7 @@ enable enable nuget_distribution_example - 0.0.23 + 0.0.26 Hans Christian Winther-Sørensen WSH Distributing shared project files example diff --git a/shared/NugetDistSample/Program.cs b/shared/NugetDistSample/Program.cs index ca3a0df..e970e9d 100644 --- a/shared/NugetDistSample/Program.cs +++ b/shared/NugetDistSample/Program.cs @@ -61,10 +61,10 @@ static bool ExecuteCommandIfLineDoesNotExist(string filePath, string line, string command) { var lines = File.ReadAllLines(filePath); - if (lines.Contains(line)) + if (Array.Exists(lines, l => l.Contains(line))) return false; - Console.WriteLine($"Executing: {command}"); + Console.WriteLine($"Executing command: {command}"); ProcessStartInfo processStartInfo = new() { diff --git a/shared/NugetDistSample/content/.editorconfig b/shared/NugetDistSample/content/.editorconfig index 875356e..7b92ea1 100644 --- a/shared/NugetDistSample/content/.editorconfig +++ b/shared/NugetDistSample/content/.editorconfig @@ -1,232 +1,152 @@ -# Remove the line below if you want to inherit .editorconfig settings from higher directories -root = true -# C# files -[*.cs] - -#### Core EditorConfig Options #### +[*.{blockshader,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cshtml,cu,cuh,cxx,cxxm,fx,fxh,h,h++,hh,hlsl,hlsli,hlslinc,hp,hpp,htm,html,hxx,icc,inc,inl,ino,ipp,ixx,mpp,mq4,mq5,mqh,mxx,razor,shaderFoundry,tcc,tpp,urtshader,usf,ush}] +indent_style = tab +indent_size = tab +tab_width = 4 -# Indentation and spacing -indent_size = 4 +[*.{asax,ascx,aspx,axaml,cs,master,paml,skin,vb,xaml,xamlx,xoml}] indent_style = space +indent_size = 4 tab_width = 4 -# New line preferences -end_of_line = crlf -insert_final_newline = false - -#### .NET Coding Conventions #### - -# Organize usings -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = false -file_header_template = unset - -# this. and Me. preferences -dotnet_style_qualification_for_event = false -dotnet_style_qualification_for_field = false -dotnet_style_qualification_for_method = false -dotnet_style_qualification_for_property = false - -# Language keywords vs BCL types preferences -dotnet_style_predefined_type_for_locals_parameters_members = true -dotnet_style_predefined_type_for_member_access = true - -# Parentheses preferences -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity -dotnet_style_parentheses_in_other_operators = never_if_unnecessary -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity - -# Modifier preferences -dotnet_style_require_accessibility_modifiers = for_non_interface_members - -# Expression-level preferences -dotnet_style_coalesce_expression = true -dotnet_style_collection_initializer = true -dotnet_style_explicit_tuple_names = true -dotnet_style_namespace_match_folder = true -dotnet_style_null_propagation = true -dotnet_style_object_initializer = true -dotnet_style_operator_placement_when_wrapping = beginning_of_line -dotnet_style_prefer_auto_properties = true -dotnet_style_prefer_collection_expression = when_types_loosely_match -dotnet_style_prefer_compound_assignment = true -dotnet_style_prefer_conditional_expression_over_assignment = true -dotnet_style_prefer_conditional_expression_over_return = true -dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed -dotnet_style_prefer_inferred_anonymous_type_member_names = true -dotnet_style_prefer_inferred_tuple_names = true -dotnet_style_prefer_is_null_check_over_reference_equality_method = true -dotnet_style_prefer_simplified_boolean_expressions = true -dotnet_style_prefer_simplified_interpolation = true - -# Field preferences -dotnet_style_readonly_field = true - -# Parameter preferences -dotnet_code_quality_unused_parameters = all - -# Suppression preferences -dotnet_remove_unnecessary_suppression_exclusions = none - -# New line preferences -dotnet_style_allow_multiple_blank_lines_experimental = true -dotnet_style_allow_statement_immediately_after_block_experimental = true - -#### C# Coding Conventions #### - -# var preferences -csharp_style_var_elsewhere = false -csharp_style_var_for_built_in_types = false -csharp_style_var_when_type_is_apparent = false - -# Expression-bodied members -csharp_style_expression_bodied_accessors = true -csharp_style_expression_bodied_constructors = false -csharp_style_expression_bodied_indexers = true -csharp_style_expression_bodied_lambdas = true -csharp_style_expression_bodied_local_functions = false -csharp_style_expression_bodied_methods = false -csharp_style_expression_bodied_operators = false -csharp_style_expression_bodied_properties = true - -# Pattern matching preferences -csharp_style_pattern_matching_over_as_with_null_check = true -csharp_style_pattern_matching_over_is_with_cast_check = true -csharp_style_prefer_extended_property_pattern = true -csharp_style_prefer_not_pattern = true -csharp_style_prefer_pattern_matching = true -csharp_style_prefer_switch_expression = true - -# Null-checking preferences -csharp_style_conditional_delegate_call = true - -# Modifier preferences -csharp_prefer_static_anonymous_function = true -csharp_prefer_static_local_function = true -csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async -csharp_style_prefer_readonly_struct = true -csharp_style_prefer_readonly_struct_member = true - -# Code-block preferences -csharp_prefer_braces = true -csharp_prefer_simple_using_statement = true -csharp_style_namespace_declarations = block_scoped -csharp_style_prefer_method_group_conversion = true -csharp_style_prefer_primary_constructors = true -csharp_style_prefer_top_level_statements = true - -# Expression-level preferences -csharp_prefer_simple_default_expression = true -csharp_style_deconstructed_variable_declaration = true -csharp_style_implicit_object_creation_when_type_is_apparent = true -csharp_style_inlined_variable_declaration = true -csharp_style_prefer_index_operator = true -csharp_style_prefer_local_over_anonymous_function = true -csharp_style_prefer_null_check_over_type_check = true -csharp_style_prefer_range_operator = true -csharp_style_prefer_tuple_swap = true -csharp_style_prefer_utf8_string_literals = true -csharp_style_throw_expression = true -csharp_style_unused_value_assignment_preference = discard_variable -csharp_style_unused_value_expression_statement_preference = discard_variable - -# 'using' directive preferences -csharp_using_directive_placement = outside_namespace - -# New line preferences -csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true -csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true -csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true -csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true -csharp_style_allow_embedded_statements_on_same_line_experimental = true - -#### C# Formatting Rules #### - -# New line preferences -csharp_new_line_before_catch = true -csharp_new_line_before_else = true -csharp_new_line_before_finally = true -csharp_new_line_before_members_in_anonymous_types = true -csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_open_brace = all -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_case_contents_when_block = true -csharp_indent_labels = one_less_than_current -csharp_indent_switch_labels = true - -# 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 = 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 = false -csharp_space_between_square_brackets = false - -# Wrapping preferences -csharp_preserve_single_line_blocks = true -csharp_preserve_single_line_statements = true - -#### Naming styles #### - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = - -# Naming styles - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case +[*.{appxmanifest,axml,build,config,csproj,dbml,discomap,dtd,jsproj,lsproj,njsproj,nuspec,proj,props,resw,resx,StyleCop,targets,tasks,vbproj,xml,xsd}] +indent_style = space +indent_size = 2 +tab_width = 2 + +[*] + +# Microsoft .NET properties +csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion +csharp_space_after_cast = true +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_var_elsewhere = true:suggestion +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion +dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion +dotnet_style_qualification_for_event = false:suggestion +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion + +# ReSharper properties +resharper_align_linq_query = true +resharper_align_multiline_argument = true +resharper_align_multiline_calls_chain = true +resharper_align_multiline_extends_list = true +resharper_align_multiline_for_stmt = true +resharper_align_multiline_parameter = true +resharper_align_multiple_declaration = true +resharper_align_multline_type_parameter_constrains = true +resharper_align_tuple_components = true +resharper_apply_on_completion = true +resharper_blank_lines_after_multiline_statements = 1 +resharper_blank_lines_around_auto_property = 0 +resharper_blank_lines_around_property = 0 +resharper_braces_for_for = required_for_multiline +resharper_braces_for_foreach = required_for_multiline +resharper_braces_for_while = required +resharper_constructor_or_destructor_body = expression_body +resharper_csharp_blank_lines_around_field = 0 +resharper_csharp_blank_lines_around_invocable = 0 +resharper_csharp_keep_blank_lines_in_code = 1 +resharper_csharp_keep_blank_lines_in_declarations = 1 +resharper_csharp_max_line_length = 250 +resharper_csharp_outdent_commas = true +resharper_csharp_wrap_arguments_style = chop_if_long +resharper_csharp_wrap_multiple_type_parameter_constraints_style = wrap_if_long +resharper_indent_nested_fixed_stmt = true +resharper_indent_nested_foreach_stmt = true +resharper_indent_nested_for_stmt = true +resharper_indent_nested_lock_stmt = true +resharper_indent_nested_usings_stmt = true +resharper_indent_nested_while_stmt = true +resharper_keep_existing_declaration_parens_arrangement = false +resharper_keep_existing_expr_member_arrangement = false +resharper_keep_existing_initializer_arrangement = false +resharper_local_function_body = expression_body +resharper_max_attribute_length_for_same_line = 50 +resharper_max_initializer_elements_on_line = 1 +resharper_method_or_operator_body = expression_body +resharper_new_line_before_while = true +resharper_place_accessorholder_attribute_on_same_line = false +resharper_place_accessor_attribute_on_same_line = false +resharper_place_field_attribute_on_same_line = false +resharper_place_simple_accessorholder_on_single_line = true +resharper_place_simple_accessor_on_single_line = false +resharper_place_simple_embedded_statement_on_same_line = false +resharper_place_simple_initializer_on_single_line = false +resharper_place_simple_property_pattern_on_single_line = false +resharper_qualified_using_at_nested_scope = true +resharper_space_within_single_line_array_initializer_braces = false +resharper_wrap_array_initializer_style = chop_if_long +resharper_wrap_chained_method_calls = chop_always +resharper_wrap_enum_declaration = chop_if_long +resharper_wrap_linq_expressions = chop_always + +# ReSharper inspection severities +resharper_annotate_can_be_null_parameter_highlighting = warning +resharper_annotate_can_be_null_type_member_highlighting = warning +resharper_annotate_not_null_parameter_highlighting = warning +resharper_annotate_not_null_type_member_highlighting = warning +resharper_arrange_constructor_or_destructor_body_highlighting = hint +resharper_arrange_local_function_body_highlighting = hint +resharper_arrange_method_or_operator_body_highlighting = hint +resharper_arrange_missing_parentheses_highlighting = hint +resharper_arrange_redundant_parentheses_highlighting = hint +resharper_arrange_this_qualifier_highlighting = hint +resharper_arrange_type_member_modifiers_highlighting = hint +resharper_arrange_type_modifiers_highlighting = hint +resharper_async_void_method_highlighting = warning +resharper_bad_control_braces_indent_highlighting = warning +resharper_bad_declaration_braces_indent_highlighting = warning +resharper_bad_expression_braces_indent_highlighting = warning +resharper_bad_indent_highlighting = warning +resharper_bad_namespace_braces_indent_highlighting = warning +resharper_bad_preprocessor_indent_highlighting = warning +resharper_bad_switch_braces_indent_highlighting = warning +resharper_built_in_type_reference_style_for_member_access_highlighting = hint +resharper_built_in_type_reference_style_highlighting = hint +resharper_cpp_bad_child_statement_indent_highlighting = warning +resharper_cpp_bad_control_braces_indent_highlighting = warning +resharper_cpp_bad_declaration_braces_indent_highlighting = warning +resharper_cpp_bad_expression_braces_indent_highlighting = warning +resharper_cpp_bad_indent_highlighting = warning +resharper_cpp_bad_namespace_braces_indent_highlighting = warning +resharper_cpp_bad_switch_braces_indent_highlighting = warning +resharper_cpp_incorrect_blank_lines_near_braces_highlighting = warning +resharper_cpp_missing_blank_lines_highlighting = warning +resharper_cpp_missing_indent_highlighting = warning +resharper_cpp_outdent_is_off_prev_level_highlighting = warning +resharper_cpp_redundant_blank_lines_highlighting = warning +resharper_cpp_tabs_and_spaces_mismatch_highlighting = warning +resharper_cpp_wrong_indent_size_highlighting = warning +resharper_empty_general_catch_clause_highlighting = error +resharper_function_complexity_overflow_highlighting = error +resharper_incorrect_blank_lines_near_braces_highlighting = warning +resharper_lambda_expression_can_be_made_static_highlighting = error +resharper_lambda_expression_must_be_static_highlighting = warning +resharper_loop_can_be_partly_converted_to_query_highlighting = hint +resharper_markup_attribute_typo_highlighting = none +resharper_markup_text_typo_highlighting = none +resharper_missing_blank_lines_highlighting = warning +resharper_missing_indent_highlighting = warning +resharper_nullable_warning_suppression_is_used_highlighting = warning +resharper_outdent_is_off_prev_level_highlighting = warning +resharper_possible_null_reference_exception_highlighting = error +resharper_redundant_base_qualifier_highlighting = warning +resharper_redundant_blank_lines_highlighting = warning +resharper_suggest_var_or_type_built_in_types_highlighting = hint +resharper_suggest_var_or_type_elsewhere_highlighting = hint +resharper_suggest_var_or_type_simple_types_highlighting = hint +resharper_tabs_and_spaces_mismatch_highlighting = warning +resharper_use_configure_await_false_for_async_disposable_highlighting = warning +resharper_use_nameof_expression_for_part_of_the_string_highlighting = warning +resharper_use_positional_deconstruction_pattern_highlighting = hint +resharper_use_throw_if_null_method_highlighting = warning +resharper_wrong_indent_size_highlighting = warning diff --git a/src/backend/WebApi/WebApi.csproj b/src/backend/WebApi/WebApi.csproj index d9feed8..93ef18e 100644 --- a/src/backend/WebApi/WebApi.csproj +++ b/src/backend/WebApi/WebApi.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/backend/WebApi/packages.lock.json b/src/backend/WebApi/packages.lock.json index 52d400f..57c8b7a 100644 --- a/src/backend/WebApi/packages.lock.json +++ b/src/backend/WebApi/packages.lock.json @@ -42,9 +42,9 @@ }, "nuget_distribution_example": { "type": "Direct", - "requested": "[0.0.23, )", - "resolved": "0.0.23", - "contentHash": "zX4Kz16jvf8rCg16KZg4tmFuXfrsJXEV5w5uTHHJNLLiUASCwPtF6eSbwrRMgL0HFBFwOPfXvZkjLO5mZy/ifQ==" + "requested": "[0.0.26, )", + "resolved": "0.0.26", + "contentHash": "VU3zjQ2psZmDvWs8tUNLoDdownZeVpK1j3xQTqErJsvOckH6upoSdpwZ6bTBqt89koMLm0KXp8cN1+ICsQGQCw==" }, "OpenTelemetry.Exporter.Console": { "type": "Direct", diff --git a/tests/backend/WebApi.Tests/packages.lock.json b/tests/backend/WebApi.Tests/packages.lock.json index 5a17127..facb598 100644 --- a/tests/backend/WebApi.Tests/packages.lock.json +++ b/tests/backend/WebApi.Tests/packages.lock.json @@ -685,8 +685,8 @@ }, "nuget_distribution_example": { "type": "Transitive", - "resolved": "0.0.23", - "contentHash": "zX4Kz16jvf8rCg16KZg4tmFuXfrsJXEV5w5uTHHJNLLiUASCwPtF6eSbwrRMgL0HFBFwOPfXvZkjLO5mZy/ifQ==" + "resolved": "0.0.26", + "contentHash": "VU3zjQ2psZmDvWs8tUNLoDdownZeVpK1j3xQTqErJsvOckH6upoSdpwZ6bTBqt89koMLm0KXp8cN1+ICsQGQCw==" }, "OpenTelemetry": { "type": "Transitive", @@ -1056,7 +1056,7 @@ "RabbitMQ.Client": "[6.8.1, )", "Swashbuckle.AspNetCore": "[6.9.0, )", "Swashbuckle.AspNetCore.ReDoc": "[6.9.0, )", - "nuget_distribution_example": "[0.0.23, )" + "nuget_distribution_example": "[0.0.26, )" } } }, From 1e5394760aa0d0c0ad29de3dd854da62e71531a4 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 2 Nov 2024 00:38:24 +0100 Subject: [PATCH 7/8] TEST-0008 Add nuget config --- src/backend/nuget.config | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/backend/nuget.config diff --git a/src/backend/nuget.config b/src/backend/nuget.config new file mode 100644 index 0000000..4ef3774 --- /dev/null +++ b/src/backend/nuget.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 22522611cc71527a040e27fa4a933642b93b83fe Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Sat, 2 Nov 2024 00:46:42 +0100 Subject: [PATCH 8/8] TEST-0008 Remove private nuget feed references --- src/backend/WebApi/WebApi.csproj | 1 - src/backend/WebApi/packages.lock.json | 6 ------ src/backend/nuget.config | 2 +- tests/backend/WebApi.Tests/packages.lock.json | 8 +------- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/backend/WebApi/WebApi.csproj b/src/backend/WebApi/WebApi.csproj index 93ef18e..6166efe 100644 --- a/src/backend/WebApi/WebApi.csproj +++ b/src/backend/WebApi/WebApi.csproj @@ -17,7 +17,6 @@ - diff --git a/src/backend/WebApi/packages.lock.json b/src/backend/WebApi/packages.lock.json index 57c8b7a..900def0 100644 --- a/src/backend/WebApi/packages.lock.json +++ b/src/backend/WebApi/packages.lock.json @@ -40,12 +40,6 @@ "resolved": "1.21.0", "contentHash": "8NudeHOE56YsY59HYY89akRMup8Ho+7Y3cADTGjajjWroXVU9RQai2nA6PfteB8AuzmRHZ5NZQB2BnWhQEul5g==" }, - "nuget_distribution_example": { - "type": "Direct", - "requested": "[0.0.26, )", - "resolved": "0.0.26", - "contentHash": "VU3zjQ2psZmDvWs8tUNLoDdownZeVpK1j3xQTqErJsvOckH6upoSdpwZ6bTBqt89koMLm0KXp8cN1+ICsQGQCw==" - }, "OpenTelemetry.Exporter.Console": { "type": "Direct", "requested": "[1.9.0, )", diff --git a/src/backend/nuget.config b/src/backend/nuget.config index 4ef3774..1ce49ff 100644 --- a/src/backend/nuget.config +++ b/src/backend/nuget.config @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/tests/backend/WebApi.Tests/packages.lock.json b/tests/backend/WebApi.Tests/packages.lock.json index facb598..b377daf 100644 --- a/tests/backend/WebApi.Tests/packages.lock.json +++ b/tests/backend/WebApi.Tests/packages.lock.json @@ -683,11 +683,6 @@ "resolved": "13.0.1", "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" }, - "nuget_distribution_example": { - "type": "Transitive", - "resolved": "0.0.26", - "contentHash": "VU3zjQ2psZmDvWs8tUNLoDdownZeVpK1j3xQTqErJsvOckH6upoSdpwZ6bTBqt89koMLm0KXp8cN1+ICsQGQCw==" - }, "OpenTelemetry": { "type": "Transitive", "resolved": "1.9.0", @@ -1055,8 +1050,7 @@ "OpenTelemetry.Instrumentation.Runtime": "[1.9.0, )", "RabbitMQ.Client": "[6.8.1, )", "Swashbuckle.AspNetCore": "[6.9.0, )", - "Swashbuckle.AspNetCore.ReDoc": "[6.9.0, )", - "nuget_distribution_example": "[0.0.26, )" + "Swashbuckle.AspNetCore.ReDoc": "[6.9.0, )" } } },