Skip to content

Commit

Permalink
Explicitly omit "#nullable enable" generation
Browse files Browse the repository at this point in the history
  • Loading branch information
virzak committed Feb 12, 2024
1 parent ab626ba commit 7b38b62
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/FluentValidation/AbstractValidator.cs
Expand Up @@ -137,7 +137,7 @@ public Task<ValidationResult> ValidateAsync(T instance, CancellationToken cancel
return await ValidateInternalAsync(context, cancellation);
}

[Zomp.SyncMethodGenerator.CreateSyncVersion]
[Zomp.SyncMethodGenerator.CreateSyncVersion(OmitNullableDirective = true)]
private async ValueTask<ValidationResult> ValidateInternalAsync(ValidationContext<T> context, CancellationToken cancellation) {
var result = new ValidationResult(context.Failures);
bool shouldContinue = PreValidate(context, result);
Expand Down
2 changes: 1 addition & 1 deletion src/FluentValidation/FluentValidation.csproj
Expand Up @@ -28,7 +28,7 @@ Full release notes can be found at https://github.com/FluentValidation/FluentVal
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.*" PrivateAssets="All" />
<PackageReference Include="Zomp.SyncMethodGenerator" Version="1.1.2" PrivateAssets="All" />
<PackageReference Include="Zomp.SyncMethodGenerator" Version="1.3.8-beta" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
Expand Down
4 changes: 2 additions & 2 deletions src/FluentValidation/Internal/CollectionPropertyRule.cs
Expand Up @@ -62,7 +62,7 @@ public CollectionPropertyRule(MemberInfo member, Func<T, IEnumerable<TElement>>
}


[Zomp.SyncMethodGenerator.CreateSyncVersion]
[Zomp.SyncMethodGenerator.CreateSyncVersion(OmitNullableDirective = true)]
async ValueTask IValidationRuleInternal<T>.ValidateAsync(ValidationContext<T> context, CancellationToken cancellation) {
string displayName = GetDisplayName(context);

Expand Down Expand Up @@ -187,7 +187,7 @@ public CollectionPropertyRule(MemberInfo member, Func<T, IEnumerable<TElement>>
DependentRules.AddRange(rules);
}

[Zomp.SyncMethodGenerator.CreateSyncVersion]
[Zomp.SyncMethodGenerator.CreateSyncVersion(OmitNullableDirective = true)]
private async ValueTask<List<RuleComponent<T, TElement>>> GetValidatorsToExecuteAsync(ValidationContext<T> context, CancellationToken cancellation) {
// Loop over each validator and check if its condition allows it to run.
// This needs to be done prior to the main loop as within a collection rule
Expand Down
2 changes: 1 addition & 1 deletion src/FluentValidation/Internal/IncludeRule.cs
Expand Up @@ -52,7 +52,7 @@ public static IncludeRule<T> Create<TValidator>(Func<T, TValidator> func, Func<C
return new IncludeRule<T>((ctx, _) => func(ctx.InstanceToValidate), cascadeModeThunk, typeof(T), typeof(TValidator));
}

[Zomp.SyncMethodGenerator.CreateSyncVersion]
[Zomp.SyncMethodGenerator.CreateSyncVersion(OmitNullableDirective = true)]
public override async ValueTask ValidateAsync(ValidationContext<T> context, CancellationToken cancellation) {
// Special handling for the MemberName selector.
// We need to disable the MemberName selector's cascade functionality whilst executing
Expand Down
2 changes: 1 addition & 1 deletion src/FluentValidation/Internal/PropertyRule.cs
Expand Up @@ -48,7 +48,7 @@ public PropertyRule(MemberInfo member, Func<T, TProperty> propertyFunc, LambdaEx
/// </summary>
/// <param name="context">Validation Context</param>
/// <param name="cancellation"></param>
[Zomp.SyncMethodGenerator.CreateSyncVersion]
[Zomp.SyncMethodGenerator.CreateSyncVersion(OmitNullableDirective = true)]
public virtual async ValueTask ValidateAsync(ValidationContext<T> context, CancellationToken cancellation) {
string displayName = GetDisplayName(context);

Expand Down

0 comments on commit 7b38b62

Please sign in to comment.