From 496432cf45f8677b9ad91a6127c8a71e47d56878 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Wed, 5 Jul 2023 19:35:48 +0100 Subject: [PATCH 1/3] Tidy up DotNet Commands --- .editorconfig | 29 +++++ ModularPipelines.DotNet/DotNet.cs | 120 +++++++++--------- ModularPipelines.DotNet/IDotNet.cs | 3 +- .../Options/DotNetFormatOptions.cs | 33 +++++ 4 files changed, 125 insertions(+), 60 deletions(-) create mode 100644 .editorconfig create mode 100644 ModularPipelines.DotNet/Options/DotNetFormatOptions.cs diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..79e63dee72 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,29 @@ +root = true + +[*] +insert_final_newline = false +trim_trailing_whitespace = true + +ij_any_if_brace_force = always +ij_any_do_while_brace_force = always +ij_any_for_brace_force = always +ij_any_while_brace_force = always + +[*.cs] +ij_any_space_before_colon = false +ij_any_space_after_colon = true + +ij_any_space_before_comma = false +ij_any_space_after_comma = true + +ij_any_space_before_quest = true +ij_any_space_after_quest = true + +ij_any_while_on_new_line = true +ij_any_finally_on_new_line = true +insert_final_newline = true +ij_any_catch_on_new_line = true +ij_any_else_on_new_line = true + +ij_any_align_group_field_declarations = true + diff --git a/ModularPipelines.DotNet/DotNet.cs b/ModularPipelines.DotNet/DotNet.cs index d344225070..0584fee143 100644 --- a/ModularPipelines.DotNet/DotNet.cs +++ b/ModularPipelines.DotNet/DotNet.cs @@ -8,38 +8,61 @@ namespace ModularPipelines.DotNet; public class DotNet : IDotNet { - private readonly IModuleContext _context; + private readonly ICommand _command; + private readonly IFileSystemContext _fileSystemContext; private readonly ITrxParser _trxParser; - public DotNet(IModuleContext context, ITrxParser trxParser) + public DotNet(ITrxParser trxParser, ICommand command, IFileSystemContext fileSystemContext) { - _context = context; _trxParser = trxParser; + _command = command; + _fileSystemContext = fileSystemContext; } - + public Task Restore(DotNetRestoreOptions options, CancellationToken cancellationToken = default) { - return RunCommand(ToDotNetCommandOptions("restore", options), options, cancellationToken); - } + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "restore") with + { + AdditionalSwitches = options.AdditionalSwitches + }; + + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } public Task Build(DotNetBuildOptions options, CancellationToken cancellationToken = default) { - return RunCommand(ToDotNetCommandOptions("build", options), options, cancellationToken); - } + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "build") with + { + AdditionalSwitches = options.AdditionalSwitches + }; + + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } public Task Publish(DotNetPublishOptions options, CancellationToken cancellationToken = default) { - return RunCommand(ToDotNetCommandOptions("publish", options), options, cancellationToken); - } + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "publish") with + { + AdditionalSwitches = options.AdditionalSwitches + }; + + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } public Task Pack(DotNetPackOptions options, CancellationToken cancellationToken = default) { - return RunCommand(ToDotNetCommandOptions("pack", options), options, cancellationToken); - } + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "pack") with + { + AdditionalSwitches = options.AdditionalSwitches + }; + + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } public Task Clean(DotNetCleanOptions options, CancellationToken cancellationToken = default) { - return RunCommand(ToDotNetCommandOptions("clean", options), options, cancellationToken); + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "clean") with + { + AdditionalSwitches = options.AdditionalSwitches + }; + + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } public async Task Test(DotNetTestOptions options, CancellationToken cancellationToken = default) @@ -48,65 +71,44 @@ public async Task Test(DotNetTestOptions options, Cancellation options.Logger ??= new List(); options.Logger.Add($"trx;logfilename={trxFilePath}"); - - var command = await RunCommand(ToDotNetCommandOptions("test", options), options, cancellationToken); - var trxContents = await _context.FileSystem.GetFile(trxFilePath).ReadAsync(); + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "test") with + { + AdditionalSwitches = options.AdditionalSwitches + }; + + await _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); + + var trxContents = await _fileSystemContext.GetFile(trxFilePath).ReadAsync(); return _trxParser.ParseTestResult(trxContents); } - public Task Version(CommandLineOptions? options, CancellationToken cancellationToken = default) + public Task Format(DotNetFormatOptions options, CancellationToken cancellationToken = default) { - options ??= new CommandLineOptions(); - - return RunCommand(new DotNetCommandOptions + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "format") with { - Command = new[] { "--version" }, - EnvironmentVariables = options.EnvironmentVariables, - WorkingDirectory = options.WorkingDirectory, - Credentials = options.Credentials, - LogInput = options.LogInput, - LogOutput = options.LogOutput - }, null, cancellationToken); - } + AdditionalSwitches = options.AdditionalSwitches + }; - public Task CustomCommand(DotNetCommandOptions options, CancellationToken cancellationToken = default) + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } + + public Task Version(CommandLineOptions? options, CancellationToken cancellationToken = default) { - return RunCommand(options, null, cancellationToken); + options ??= new CommandLineOptions(); + + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "--version"); + + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } - private static DotNetCommandOptions ToDotNetCommandOptions(string command, DotNetOptions options) + public Task CustomCommand(DotNetCommandOptions options, CancellationToken cancellationToken = default) { - return new DotNetCommandOptions + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", options.Command ?? ArraySegment.Empty) with { - Command = new []{ command }, - EnvironmentVariables = options.EnvironmentVariables, - AdditionalSwitches = options.AdditionalSwitches, - TargetPath = options.TargetPath, - WorkingDirectory = options.WorkingDirectory, - Credentials = options.Credentials, - LogInput = options.LogInput, - LogOutput = options.LogOutput + AdditionalSwitches = options.AdditionalSwitches }; - } - - private Task RunCommand(DotNetCommandOptions options, object? optionsObject, CancellationToken cancellationToken) - { - var arguments = options.Command?.ToList() ?? new List(); - arguments.AddNonNullOrEmpty(options.TargetPath); - - return _context.Command.ExecuteCommandLineTool(new CommandLineToolOptions("dotnet") - { - Arguments = arguments, - EnvironmentVariables = options.EnvironmentVariables, - WorkingDirectory = options.WorkingDirectory, - Credentials = options.Credentials, - LogInput = options.LogInput, - LogOutput = options.LogOutput, - AdditionalSwitches = options.AdditionalSwitches, - ArgumentsOptionObject = optionsObject - }, cancellationToken); + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } -} \ No newline at end of file +} diff --git a/ModularPipelines.DotNet/IDotNet.cs b/ModularPipelines.DotNet/IDotNet.cs index 80f2f5ba52..938b4718dd 100644 --- a/ModularPipelines.DotNet/IDotNet.cs +++ b/ModularPipelines.DotNet/IDotNet.cs @@ -12,8 +12,9 @@ public interface IDotNet Task Pack(DotNetPackOptions options, CancellationToken cancellationToken = default); Task Clean(DotNetCleanOptions options, CancellationToken cancellationToken = default); Task Test(DotNetTestOptions options, CancellationToken cancellationToken = default); + Task Format(DotNetFormatOptions options, CancellationToken cancellationToken = default); Task Version(CommandLineOptions? options = null, CancellationToken cancellationToken = default); Task CustomCommand(DotNetCommandOptions options, CancellationToken cancellationToken = default); -} \ No newline at end of file +} diff --git a/ModularPipelines.DotNet/Options/DotNetFormatOptions.cs b/ModularPipelines.DotNet/Options/DotNetFormatOptions.cs new file mode 100644 index 0000000000..93888ee97b --- /dev/null +++ b/ModularPipelines.DotNet/Options/DotNetFormatOptions.cs @@ -0,0 +1,33 @@ +using ModularPipelines.Attributes; + +namespace ModularPipelines.DotNet.Options; + +public record DotNetFormatOptions : DotNetOptions +{ + [CommandLongSwitch("diagnostics", SwitchValueSeparator = " ")] + public string Diagnostics { get; init; } + + [BooleanCommandSwitch("severity")] + public string Severity { get; init; } + + [BooleanCommandSwitch("no-restore")] + public bool NoRestore { get; init; } + + [BooleanCommandSwitch("verify-no-changes")] + public bool VerifyNoChanges { get; init; } = true; + + [CommandLongSwitch("include", SwitchValueSeparator = " ")] + public string Include { get; init; } + + [CommandLongSwitch("exclude", SwitchValueSeparator = " ")] + public string Exclude { get; init; } + + [BooleanCommandSwitch("include-generated")] + public bool IncludeGenerated { get; init; } + + [CommandLongSwitch("binary-log", SwitchValueSeparator = " ")] + public string BinaryLogPath { get; init; } + + [CommandLongSwitch("report", SwitchValueSeparator = " ")] + public string ReportPath { get; init; } +} From be835cb6c62ae34ce2ecc38fdf6187260cb318ce Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Wed, 5 Jul 2023 19:50:08 +0100 Subject: [PATCH 2/3] Fix missing target on dotnet commands --- .editorconfig | 130 ++++++++++++++++++ .../Options/DockerBuildOptions.cs | 1 - ModularPipelines.DotNet/DotNet.cs | 84 +++++------ ModularPipelines.DotNet/IDotNet.cs | 3 +- ModularPipelines.NuGet/NuGet.cs | 3 - 5 files changed, 167 insertions(+), 54 deletions(-) diff --git a/.editorconfig b/.editorconfig index 79e63dee72..1b1caf6355 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,4 +26,134 @@ ij_any_catch_on_new_line = true ij_any_else_on_new_line = true ij_any_align_group_field_declarations = true +csharp_using_directive_placement = outside_namespace:error +csharp_prefer_simple_using_statement = true:error +csharp_prefer_braces = true:error +csharp_style_namespace_declarations = file_scoped:error +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_indent_labels = one_less_than_current +csharp_space_after_cast = true +csharp_space_around_binary_operators = before_and_after +csharp_style_throw_expression = true:suggestion +csharp_style_prefer_null_check_over_type_check = true:suggestion +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_prefer_local_over_anonymous_function = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion +csharp_style_prefer_tuple_swap = true:suggestion +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent +csharp_prefer_static_local_function = true:suggestion +csharp_style_prefer_readonly_struct = true:suggestion +csharp_style_prefer_readonly_struct_member = true:suggestion +csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent +csharp_style_conditional_delegate_call = true:suggestion +csharp_style_prefer_switch_expression = true:suggestion +csharp_style_prefer_pattern_matching = true:silent +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_prefer_not_pattern = true:suggestion +csharp_style_prefer_extended_property_pattern = true:suggestion +csharp_style_var_for_built_in_types = true:error +csharp_style_var_when_type_is_apparent = true:error +csharp_style_var_elsewhere = true:error + +[*.{cs,vb}] +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = error +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 = error +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 = error +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.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 + +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.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_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +indent_size = 4 +end_of_line = crlf +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_namespace_match_folder = true:suggestion +dotnet_style_readonly_field = true:suggestion +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent +dotnet_style_allow_multiple_blank_lines_experimental = true:silent +dotnet_style_allow_statement_immediately_after_block_experimental = true:silent +dotnet_code_quality_unused_parameters = all:suggestion +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_qualification_for_field = false:error +dotnet_style_qualification_for_property = false:error +dotnet_style_qualification_for_method = false:error +dotnet_style_qualification_for_event = false:error diff --git a/ModularPipelines.Docker/Options/DockerBuildOptions.cs b/ModularPipelines.Docker/Options/DockerBuildOptions.cs index b979e69f26..9d84a9d4c7 100644 --- a/ModularPipelines.Docker/Options/DockerBuildOptions.cs +++ b/ModularPipelines.Docker/Options/DockerBuildOptions.cs @@ -1,7 +1,6 @@ using ModularPipelines.Attributes; using ModularPipelines.FileSystem; using ModularPipelines.Options; -using File = ModularPipelines.FileSystem.File; namespace ModularPipelines.Docker.Options; diff --git a/ModularPipelines.DotNet/DotNet.cs b/ModularPipelines.DotNet/DotNet.cs index 0584fee143..8823ae40d8 100644 --- a/ModularPipelines.DotNet/DotNet.cs +++ b/ModularPipelines.DotNet/DotNet.cs @@ -2,7 +2,6 @@ using ModularPipelines.Context; using ModularPipelines.DotNet.Options; using ModularPipelines.Extensions; -using ModularPipelines.Options; namespace ModularPipelines.DotNet; @@ -21,48 +20,34 @@ public DotNet(ITrxParser trxParser, ICommand command, IFileSystemContext fileSys public Task Restore(DotNetRestoreOptions options, CancellationToken cancellationToken = default) { - var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "restore") with - { - AdditionalSwitches = options.AdditionalSwitches - }; - - return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } + var args = new List {"restore"}; + args.AddNonNullOrEmpty(options.TargetPath); + return ExecuteCommandLineTool(options, args, cancellationToken); + } public Task Build(DotNetBuildOptions options, CancellationToken cancellationToken = default) { - var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "build") with - { - AdditionalSwitches = options.AdditionalSwitches - }; - - return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } + var args = new List {"build"}; + args.AddNonNullOrEmpty(options.TargetPath); + return ExecuteCommandLineTool(options, args, cancellationToken); } public Task Publish(DotNetPublishOptions options, CancellationToken cancellationToken = default) { - var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "publish") with - { - AdditionalSwitches = options.AdditionalSwitches - }; - - return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } + var args = new List {"publish"}; + args.AddNonNullOrEmpty(options.TargetPath); + return ExecuteCommandLineTool(options, args, cancellationToken); } public Task Pack(DotNetPackOptions options, CancellationToken cancellationToken = default) { - var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "pack") with - { - AdditionalSwitches = options.AdditionalSwitches - }; - - return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } + var args = new List {"pack"}; + args.AddNonNullOrEmpty(options.TargetPath); + return ExecuteCommandLineTool(options, args, cancellationToken); } public Task Clean(DotNetCleanOptions options, CancellationToken cancellationToken = default) { - var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "clean") with - { - AdditionalSwitches = options.AdditionalSwitches - }; - - return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); + var args = new List {"clean"}; + args.AddNonNullOrEmpty(options.TargetPath); + return ExecuteCommandLineTool(options, args, cancellationToken); } public async Task Test(DotNetTestOptions options, CancellationToken cancellationToken = default) @@ -72,12 +57,9 @@ public async Task Test(DotNetTestOptions options, Cancellation options.Logger ??= new List(); options.Logger.Add($"trx;logfilename={trxFilePath}"); - var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "test") with - { - AdditionalSwitches = options.AdditionalSwitches - }; - - await _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); + var args = new List {"test"}; + args.AddNonNullOrEmpty(options.TargetPath); + await ExecuteCommandLineTool(options, args, cancellationToken); var trxContents = await _fileSystemContext.GetFile(trxFilePath).ReadAsync(); @@ -86,20 +68,16 @@ public async Task Test(DotNetTestOptions options, Cancellation public Task Format(DotNetFormatOptions options, CancellationToken cancellationToken = default) { - var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "format") with - { - AdditionalSwitches = options.AdditionalSwitches - }; - - return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } + var args = new List {"format"}; + args.AddNonNullOrEmpty(options.TargetPath); + return ExecuteCommandLineTool(options, args, cancellationToken); + } - public Task Version(CommandLineOptions? options, CancellationToken cancellationToken = default) + public Task Version(DotNetOptions? options, CancellationToken cancellationToken = default) { - options ??= new CommandLineOptions(); + options ??= new DotNetOptions(); - var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", "--version"); - - return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); + return ExecuteCommandLineTool(options, new[] {"--version"}, cancellationToken); } public Task CustomCommand(DotNetCommandOptions options, CancellationToken cancellationToken = default) @@ -111,4 +89,14 @@ public Task CustomCommand(DotNetCommandOptions options, Cancellat return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); } + + private Task ExecuteCommandLineTool(DotNetOptions options, IEnumerable arguments, CancellationToken cancellationToken) + { + var commandLineToolOptions = options.ToCommandLineToolOptions("dotnet", arguments) with + { + AdditionalSwitches = options.AdditionalSwitches + }; + + return _command.ExecuteCommandLineTool(commandLineToolOptions, cancellationToken); + } } diff --git a/ModularPipelines.DotNet/IDotNet.cs b/ModularPipelines.DotNet/IDotNet.cs index 938b4718dd..e57b5be588 100644 --- a/ModularPipelines.DotNet/IDotNet.cs +++ b/ModularPipelines.DotNet/IDotNet.cs @@ -1,6 +1,5 @@ using ModularPipelines.Models; using ModularPipelines.DotNet.Options; -using ModularPipelines.Options; namespace ModularPipelines.DotNet; @@ -14,7 +13,7 @@ public interface IDotNet Task Test(DotNetTestOptions options, CancellationToken cancellationToken = default); Task Format(DotNetFormatOptions options, CancellationToken cancellationToken = default); - Task Version(CommandLineOptions? options = null, CancellationToken cancellationToken = default); + Task Version(DotNetOptions? options = null, CancellationToken cancellationToken = default); Task CustomCommand(DotNetCommandOptions options, CancellationToken cancellationToken = default); } diff --git a/ModularPipelines.NuGet/NuGet.cs b/ModularPipelines.NuGet/NuGet.cs index 35834c91af..6482d56ef7 100644 --- a/ModularPipelines.NuGet/NuGet.cs +++ b/ModularPipelines.NuGet/NuGet.cs @@ -1,10 +1,7 @@ using ModularPipelines.Models; using ModularPipelines.Context; -using ModularPipelines.DotNet.Extensions; -using ModularPipelines.DotNet.Options; using ModularPipelines.Extensions; using ModularPipelines.NuGet.Options; -using ModularPipelines.Options; namespace ModularPipelines.NuGet; From f3242641fbf3af85ea61484a089d5a25e150f342 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Wed, 5 Jul 2023 19:51:13 +0100 Subject: [PATCH 3/3] Fix naming error --- .editorconfig | 2 +- .../ModularPipelines.Analyzers.Test/Net.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index 1b1caf6355..997d3aa4ff 100644 --- a/.editorconfig +++ b/.editorconfig @@ -89,7 +89,7 @@ dotnet_naming_rule.types_should_be_pascal_case.severity = error 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 = error +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 diff --git a/ModularPipelines.Analyzers/ModularPipelines.Analyzers.Test/Net.cs b/ModularPipelines.Analyzers/ModularPipelines.Analyzers.Test/Net.cs index 9272494ed3..398183726a 100644 --- a/ModularPipelines.Analyzers/ModularPipelines.Analyzers.Test/Net.cs +++ b/ModularPipelines.Analyzers/ModularPipelines.Analyzers.Test/Net.cs @@ -4,7 +4,7 @@ namespace ModularPipelines.Analyzers.Test; public class Net { - private static readonly Lazy _lazyNet60 = new(() => + private static readonly Lazy LazyNet60 = new(() => new ReferenceAssemblies( "net6.0", new PackageIdentity( @@ -12,5 +12,5 @@ public class Net "6.0.19"), Path.Combine("ref", "net6.0"))); - public static ReferenceAssemblies Net60 => _lazyNet60.Value; + public static ReferenceAssemblies Net60 => LazyNet60.Value; } \ No newline at end of file