Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TUnit.Analyzers.Tests/MethodDataSourceAnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ await Verifier.VerifyAnalyzerAsync("""
using TUnit.Core;
using System.Diagnostics.CodeAnalysis;

[SuppressMessage("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")]
[UnconditionalSuppressMessage("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")]
public class MethodDataSourceDrivenWithCancellationTokenTests
{
[Test]
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Assertions.Tests/AssertMultipleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace TUnit.Assertions.Tests;

[SuppressMessage("Usage", "TUnitAssertions0005:Assert.That(...) should not be used with a constant value")]
[UnconditionalSuppressMessage("Usage", "TUnitAssertions0005:Assert.That(...) should not be used with a constant value")]
public class AssertMultipleTests
{
[Test]
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Assertions.Tests/Old/AssertMultipleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace TUnit.Assertions.Tests.Old;

[SuppressMessage("Usage", "TUnitAssertions0005:Assert.That(...) should not be used with a constant value")]
[UnconditionalSuppressMessage("Usage", "TUnitAssertions0005:Assert.That(...) should not be used with a constant value")]
public class AssertMultipleTests
{
[Test]
Expand Down
4 changes: 2 additions & 2 deletions TUnit.Assertions/AssertionBuilders/Groups/AssertionGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

namespace TUnit.Assertions.AssertionBuilders.Groups;

[SuppressMessage("Usage", "TUnitAssertions0002:Assert statements must be awaited")]
[SuppressMessage("Usage", "TUnitAssertions0008:ValueTasks should be awaited when used within Assert.That(...)")]
[UnconditionalSuppressMessage("Usage", "TUnitAssertions0002:Assert statements must be awaited")]
[UnconditionalSuppressMessage("Usage", "TUnitAssertions0008:ValueTasks should be awaited when used within Assert.That(...)")]
public static class AssertionGroup
{
public static OrAssertionGroupInvoker<TActual, TAssertionBuilder> Or<TActual, TAssertionBuilder>(AssertionGroup<TActual, TAssertionBuilder> group1, AssertionGroup<TActual, TAssertionBuilder> group2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace TUnit.Assertions.Extensions;

[SuppressMessage("Usage", "TUnitAssertions0003:Compiler argument populated")]
[UnconditionalSuppressMessage("Usage", "TUnitAssertions0003:Compiler argument populated")]
public static class CollectionsIsExtensions
{
public static InvokableValueAssertionBuilder<TActual> IsEquivalentTo<TActual,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace TUnit.Assertions.Extensions;

[SuppressMessage("Usage", "TUnitAssertions0003:Compiler argument populated")]
[UnconditionalSuppressMessage("Usage", "TUnitAssertions0003:Compiler argument populated")]
public static class ImmutableArrayIsExtensions
{
public static InvokableValueAssertionBuilder<ImmutableArray<TInner>> IsEquivalentTo<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : global::TU
Namespace = "TUnit.TestProject",
Attributes =
[
new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
new global::System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
],
Parameters = [],
Properties = [],
Expand Down Expand Up @@ -181,7 +181,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : global::TU
Namespace = "TUnit.TestProject",
Attributes =
[
new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
new global::System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
],
Parameters = [],
Properties = [],
Expand Down Expand Up @@ -284,7 +284,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : global::TU
Namespace = "TUnit.TestProject",
Attributes =
[
new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
new global::System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
],
Parameters = [],
Properties = [],
Expand Down Expand Up @@ -391,7 +391,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : global::TU
Namespace = "TUnit.TestProject",
Attributes =
[
new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
new global::System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
],
Parameters = [],
Properties = [],
Expand Down Expand Up @@ -498,7 +498,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : global::TU
Namespace = "TUnit.TestProject",
Attributes =
[
new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
new global::System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
],
Parameters = [],
Properties = [],
Expand Down Expand Up @@ -605,7 +605,7 @@ file partial class MethodDataSourceDrivenWithCancellationTokenTests : global::TU
Namespace = "TUnit.TestProject",
Attributes =
[
new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
new global::System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute("Usage", "TUnit0046:Return a `Func<T>` rather than a `<T>`")
],
Parameters = [],
Properties = [],
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Core.SourceGenerator.Tests/ReferencesHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TUnit.Core.SourceGenerator.Tests;

[SuppressMessage("SingleFile", "IL3000:Avoid accessing Assembly file path when publishing as a single file")]
[UnconditionalSuppressMessage("SingleFile", "IL3000:Avoid accessing Assembly file path when publishing as a single file")]
internal class ReferencesHelper
{
public static readonly List<PortableExecutableReference> References =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ file partial class Hooks_STAThreadTests : global::TUnit.Core.Interfaces.SourceGe
Namespace = "TUnit.TestProject",
Attributes =
[
new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility")
new global::System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility")
],
Parameters = [],
Properties = [],
Expand Down Expand Up @@ -156,7 +156,7 @@ file partial class Hooks_STAThreadTests : global::TUnit.Core.Interfaces.SourceGe
Namespace = "TUnit.TestProject",
Attributes =
[
new global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility")
new global::System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute("Interoperability", "CA1416:Validate platform compatibility")
],
Parameters = [],
Properties = [],
Expand Down
9 changes: 5 additions & 4 deletions TUnit.Core/AsyncConvert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,17 @@ public static ValueTask ConvertObject(object? invoke)
if (type.IsGenericType
&& type.GetGenericTypeDefinition().FullName == "Microsoft.FSharp.Control.FSharpAsync`1")
{
#pragma warning disable
return StartAsFSharpTask(invoke, type);
#pragma warning restore
}

throw new ArgumentException("Invalid object type: " + type.Name, nameof(invoke));
}

[RequiresDynamicCode("Dynamic code is required to call F# async methods.")]
[RequiresUnreferencedCode("Dynamic code is required to call F# async methods.")]
[UnconditionalSuppressMessage("Trimming", "IL2077:Target parameter argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The source field does not have matching annotations.")]
[UnconditionalSuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with \'RequiresDynamicCodeAttribute\' may break functionality when AOT compiling.")]
[UnconditionalSuppressMessage("Trimming", "IL2060:Call to \'System.Reflection.MethodInfo.MakeGenericMethod\' can not be statically analyzed. It\'s not possible to guarantee the availability of requirements of the generic method.")]
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
private static ValueTask StartAsFSharpTask(object invoke, Type type)
{
var startAsTaskOpenGenericMethod = (_fSharpAsyncType ??= type.Assembly.GetType("Microsoft.FSharp.Control.FSharpAsync"))!
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Core/Attributes/TestData/ClassDataSourceAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public ClassDataSourceAttribute(params Type[] types)
public SharedType Shared { get; set; } = SharedType.None;
public string Key { get; set; } = string.Empty;

[SuppressMessage("Trimming", "IL2062:The parameter of method has a DynamicallyAccessedMembersAttribute, but the value passed to it can not be statically analyzed.")]
[UnconditionalSuppressMessage("Trimming", "IL2062:The parameter of method has a DynamicallyAccessedMembersAttribute, but the value passed to it can not be statically analyzed.")]
public override IEnumerable<Func<object?[]?>> GenerateDataSources(DataGeneratorMetadata dataGeneratorMetadata)
{
yield return () =>
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Core/UntypedDiscoveredTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace TUnit.Core;

[SuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[UnconditionalSuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
internal record UntypedDiscoveredTest(ResettableLazy<object> ResettableLazy) : DiscoveredTest
{
public override async ValueTask ExecuteTest(CancellationToken cancellationToken)
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Engine/Helpers/FuncHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace TUnit.Engine.Helpers;

[SuppressMessage("Trimming", "IL2075:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[UnconditionalSuppressMessage("Trimming", "IL2075:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
internal class FuncHelper
{
public static bool TryInvokeFunc(object? func, out object? result)
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Engine/Helpers/TupleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace TUnit.Engine.Helpers;

[SuppressMessage("Trimming", "IL2075:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[UnconditionalSuppressMessage("Trimming", "IL2075:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
internal class TupleHelper
{
public static bool TryParseTupleToObjectArray(object? tuple, [NotNullWhen(true)] out object?[]? objectArray)
Expand Down
12 changes: 6 additions & 6 deletions TUnit.Engine/Services/BaseTestsConstructor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

namespace TUnit.Engine.Services;

[SuppressMessage("Trimming", "IL2026:Members annotated with \'RequiresUnreferencedCodeAttribute\' require dynamic access otherwise can break functionality when trimming application code")]
[SuppressMessage("Trimming", "IL2070:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The parameter of method does not have matching annotations.")]
[SuppressMessage("Trimming", "IL2071:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The parameter of method does not have matching annotations.")]
[SuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[SuppressMessage("Trimming", "IL2075:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[SuppressMessage("AOT", "IL3050:Calling members annotated with \'RequiresDynamicCodeAttribute\' may break functionality when AOT compiling.")]
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with \'RequiresUnreferencedCodeAttribute\' require dynamic access otherwise can break functionality when trimming application code")]
[UnconditionalSuppressMessage("Trimming", "IL2070:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The parameter of method does not have matching annotations.")]
[UnconditionalSuppressMessage("Trimming", "IL2071:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The parameter of method does not have matching annotations.")]
[UnconditionalSuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[UnconditionalSuppressMessage("Trimming", "IL2075:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with \'RequiresDynamicCodeAttribute\' may break functionality when AOT compiling.")]
internal abstract class BaseTestsConstructor(IExtension extension,
DependencyCollector dependencyCollector,
IServiceProvider serviceProvider) : IDataProducer
Expand Down
8 changes: 4 additions & 4 deletions TUnit.Engine/Services/ReflectionHooksCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace TUnit.Engine.Services;

[SuppressMessage("Trimming", "IL2075:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[SuppressMessage("Trimming", "IL2026:Members annotated with \'RequiresUnreferencedCodeAttribute\' require dynamic access otherwise can break functionality when trimming application code")]
[SuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[SuppressMessage("AOT", "IL3050:Calling members annotated with \'RequiresDynamicCodeAttribute\' may break functionality when AOT compiling.")]
[UnconditionalSuppressMessage("Trimming", "IL2075:\'this\' argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with \'RequiresUnreferencedCodeAttribute\' require dynamic access otherwise can break functionality when trimming application code")]
[UnconditionalSuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy \'DynamicallyAccessedMembersAttribute\' in call to target method. The return value of the source method does not have matching annotations.")]
[UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with \'RequiresDynamicCodeAttribute\' may break functionality when AOT compiling.")]
internal class ReflectionHooksCollector(string sessionId) : HooksCollectorBase(sessionId)
{
private static BindingFlags BindingFlags =>
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Engine/Services/ReflectionScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TUnit.Engine.Services;

[SuppressMessage("Trimming", "IL2026:Members annotated with \'RequiresUnreferencedCodeAttribute\' require dynamic access otherwise can break functionality when trimming application code")]
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with \'RequiresUnreferencedCodeAttribute\' require dynamic access otherwise can break functionality when trimming application code")]
internal static class ReflectionScanner
{
public static HashSet<Type> GetTypes()
Expand Down
Loading
Loading