Skip to content

Commit

Permalink
Update trimming justifications
Browse files Browse the repository at this point in the history
Some minor updates to the trimming annotations added in #1414.
  • Loading branch information
martincostello committed Jul 20, 2023
1 parent dd14ca6 commit deac12c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Polly.Core/Telemetry/ResilienceStrategyTelemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ internal ResilienceStrategyTelemetry(ResilienceTelemetrySource source, Diagnosti
[UnconditionalSuppressMessage(
"Trimming",
"IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
Justification = "The reflection is not used when consuming the event.")]
Justification = "Reflection is not used when consuming the event.")]
[UnconditionalSuppressMessage(
"AOT",
"IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.",
Justification = "The reflection is not used when consuming the event.")]
Justification = "Reflection is not used when consuming the event.")]
public void Report<TArgs>(ResilienceEvent resilienceEvent, ResilienceContext context, TArgs args)
{
Guard.NotNull(context);
Expand Down Expand Up @@ -69,11 +69,11 @@ public void Report<TArgs>(ResilienceEvent resilienceEvent, ResilienceContext con
[UnconditionalSuppressMessage(
"Trimming",
"IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
Justification = "The reflection is not used when consuming the event.")]
Justification = "Reflection is not used when consuming the event.")]
[UnconditionalSuppressMessage(
"AOT",
"IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.",
Justification = "The reflection is not used when consuming the event.")]
Justification = "Reflection is not used when consuming the event.")]
public void Report<TArgs, TResult>(ResilienceEvent resilienceEvent, OutcomeArguments<TResult, TArgs> args)
{
args.Context.AddResilienceEvent(resilienceEvent);
Expand Down
2 changes: 1 addition & 1 deletion src/Polly.Core/Utils/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ internal static class Constants
{
public const string OptionsValidation = """
This call validates the options using the data annotations attributes.
Make sure that the options are included using the '[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(OptionsType))]' attribute on top of calling method.
Make sure that the options are included by adding the '[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(OptionsType))]' attribute to the calling method.
""";
}
2 changes: 1 addition & 1 deletion src/Polly.Core/Utils/ValidationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static class ValidationHelper
[UnconditionalSuppressMessage(
"Trimming",
"IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
Justification = "The member of options are preserved and no trimmed. See builder.AddStrategy() extension.")]
Justification = "The member of options are preserved and not trimmed. See builder.AddStrategy() extension.")]
public static void ValidateObject(ResilienceValidationContext context)
{
Guard.NotNull(context);
Expand Down

0 comments on commit deac12c

Please sign in to comment.