From 96239a97f3b307ceb93edd9f6be3b9376ef5cc98 Mon Sep 17 00:00:00 2001 From: Archi Date: Mon, 27 Nov 2023 15:39:23 +0100 Subject: [PATCH] Address trim warnings --- ArchiSteamFarm/IPC/Controllers/Api/StructureController.cs | 2 ++ ArchiSteamFarm/IPC/Controllers/Api/TypeController.cs | 2 ++ ArchiSteamFarm/IPC/WebUtilities.cs | 2 +- Directory.Build.props | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/IPC/Controllers/Api/StructureController.cs b/ArchiSteamFarm/IPC/Controllers/Api/StructureController.cs index d26cd8aa1..97dd0a58d 100644 --- a/ArchiSteamFarm/IPC/Controllers/Api/StructureController.cs +++ b/ArchiSteamFarm/IPC/Controllers/Api/StructureController.cs @@ -20,6 +20,7 @@ // limitations under the License. using System; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Net; using ArchiSteamFarm.IPC.Responses; @@ -39,6 +40,7 @@ public sealed class StructureController : ArchiController { [HttpGet("{structure:required}")] [ProducesResponseType>((int) HttpStatusCode.OK)] [ProducesResponseType((int) HttpStatusCode.BadRequest)] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2072", Justification = "We don't care about trimmed assemblies, as we need it to work only with the known (used) ones")] public ActionResult StructureGet(string structure) { ArgumentException.ThrowIfNullOrEmpty(structure); diff --git a/ArchiSteamFarm/IPC/Controllers/Api/TypeController.cs b/ArchiSteamFarm/IPC/Controllers/Api/TypeController.cs index 9b5059ab9..99c3cacbe 100644 --- a/ArchiSteamFarm/IPC/Controllers/Api/TypeController.cs +++ b/ArchiSteamFarm/IPC/Controllers/Api/TypeController.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Net; @@ -44,6 +45,7 @@ public sealed class TypeController : ArchiController { [HttpGet("{type:required}")] [ProducesResponseType>((int) HttpStatusCode.OK)] [ProducesResponseType((int) HttpStatusCode.BadRequest)] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2075", Justification = "We don't care about trimmed assemblies, as we need it to work only with the known (used) ones")] public ActionResult TypeGet(string type) { ArgumentException.ThrowIfNullOrEmpty(type); diff --git a/ArchiSteamFarm/IPC/WebUtilities.cs b/ArchiSteamFarm/IPC/WebUtilities.cs index f762be6dd..87695d92c 100644 --- a/ArchiSteamFarm/IPC/WebUtilities.cs +++ b/ArchiSteamFarm/IPC/WebUtilities.cs @@ -37,7 +37,7 @@ internal static class WebUtilities { return type.GenericTypeArguments.Length == 0 ? type.FullName : $"{type.Namespace}.{type.Name}{string.Join("", type.GenericTypeArguments.Select(static innerType => $"[{innerType.GetUnifiedName()}]"))}"; } - [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "We don't care about trimmed assemblies, as we need it to work only with the known (used) ones")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2057:TypeGetType", Justification = "We don't care about trimmed assemblies, as we need it to work only with the known (used) ones")] internal static Type? ParseType(string typeText) { ArgumentException.ThrowIfNullOrEmpty(typeText); diff --git a/Directory.Build.props b/Directory.Build.props index 7398ea075..8c6a22e6d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -50,7 +50,7 @@ none true - CA1863,CS8002,IL2026,IL2057,IL2072,IL2075,IL2104,IL3000 + CA1863,CS8002,IL2026,IL2104