diff --git a/.editorconfig b/.editorconfig index a3f5ca8f69e3..25ca750e10b0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -287,18 +287,23 @@ dotnet_diagnostic.IDE0200.severity = none # Remove redundant nullable directive dotnet_diagnostic.IDE0240.severity = warning # MSBuildTask0001-0005 (Microsoft.Build.TaskAuthoring.Analyzer). MSBuildTask0001 is Error severity by -# default; the rest are warnings. All are downgraded to 'suggestion' here for report-only onboarding while -# task migration to the multithreaded model (IMultiThreadableTask / TaskEnvironment) is pending. At -# suggestion level they are info diagnostics, so they never fail the build (not even under Arcade's -# MSBuild-engine warn-as-error) without needing any WarningsNotAsErrors exemptions. +# default; the rest are warnings. MSBuildTask0002-0005 remain downgraded to 'suggestion' here for +# report-only onboarding while task migration to the multithreaded model (IMultiThreadableTask / +# TaskEnvironment) is pending. At suggestion level they are info diagnostics, so they never fail the build +# (not even under Arcade's MSBuild-engine warn-as-error) without needing any WarningsNotAsErrors exemptions. # -# Incremental re-enablement: a follow-up PR can raise a single rule globally (edit a line below to +# MSBuildTask0001 has been re-enabled at its natural 'error' severity: it flags APIs that are never safe in +# any MSBuild task (Console.*, Environment.Exit/FailFast, Process.Kill, Directory.SetCurrentDirectory, etc.) +# and whose fixes (e.g. Console.* -> Log.LogMessage) do not depend on the TaskEnvironment migration. The task +# projects already comply, so promoting it keeps the build green while preventing regressions. +# +# Incremental re-enablement: a follow-up PR can raise another rule globally (edit a line below to # 'warning'/'error' -- a "category" at a time), or raise severity for one task class by adding an # .editorconfig in that task's source directory that overrides these codes. # # NOTE: src/StaticWebAssetsSdk/.editorconfig sets `root = true`, so it does not inherit these lines and # carries its own copy of this block. Keep the two in sync. -dotnet_diagnostic.MSBuildTask0001.severity = suggestion +dotnet_diagnostic.MSBuildTask0001.severity = error dotnet_diagnostic.MSBuildTask0002.severity = suggestion dotnet_diagnostic.MSBuildTask0003.severity = suggestion dotnet_diagnostic.MSBuildTask0004.severity = suggestion diff --git a/src/Containers/Microsoft.NET.Build.Containers/ContainerBuilder.cs b/src/Containers/Microsoft.NET.Build.Containers/ContainerBuilder.cs index e8153bb32314..c9ebd74e9b05 100644 --- a/src/Containers/Microsoft.NET.Build.Containers/ContainerBuilder.cs +++ b/src/Containers/Microsoft.NET.Build.Containers/ContainerBuilder.cs @@ -100,10 +100,10 @@ internal static async Task ContainerizeAsync( } if (imageBuilder is null) { - Console.WriteLine(Resource.GetString(nameof(Strings.BaseImageNotFound)), sourceImageReference, containerRuntimeIdentifier); + logger.LogError(Resource.FormatString(nameof(Strings.BaseImageNotFound), sourceImageReference, containerRuntimeIdentifier)); return 1; } - logger.LogInformation(Strings.ContainerBuilder_StartBuildingImage, imageName, string.Join(",", imageName), sourceImageReference); + logger.LogInformation(Strings.ContainerBuilder_StartBuildingImage, imageName, string.Join(",", imageTags), sourceImageReference); cancellationToken.ThrowIfCancellationRequested(); // forcibly change the media type if required diff --git a/src/StaticWebAssetsSdk/.editorconfig b/src/StaticWebAssetsSdk/.editorconfig index 97131d5fdf35..800fe9188e0a 100644 --- a/src/StaticWebAssetsSdk/.editorconfig +++ b/src/StaticWebAssetsSdk/.editorconfig @@ -94,12 +94,13 @@ charset = utf-8-bom [*.{cs,vb}] -# MSBuildTask0001-0005 (Microsoft.Build.TaskAuthoring.Analyzer) downgraded to 'suggestion' for report-only +# MSBuildTask0002-0005 (Microsoft.Build.TaskAuthoring.Analyzer) downgraded to 'suggestion' for report-only # onboarding while task migration to the multithreaded model (IMultiThreadableTask / TaskEnvironment) is -# pending. This must be duplicated from the repo-root .editorconfig because this file sets `root = true`, -# which severs inheritance from the root. Raise these to 'warning'/'error' (here or in a more specific -# nested .editorconfig) as task classes are migrated. -dotnet_diagnostic.MSBuildTask0001.severity = suggestion +# pending. MSBuildTask0001 is enabled at its natural 'error' severity (it flags never-safe APIs whose fixes +# don't need the TaskEnvironment migration). This must be kept in sync with the repo-root .editorconfig +# because this file sets `root = true`, which severs inheritance from the root. Raise the remaining codes to +# 'warning'/'error' (here or in a more specific nested .editorconfig) as task classes are migrated. +dotnet_diagnostic.MSBuildTask0001.severity = error dotnet_diagnostic.MSBuildTask0002.severity = suggestion dotnet_diagnostic.MSBuildTask0003.severity = suggestion dotnet_diagnostic.MSBuildTask0004.severity = suggestion