Skip to content

Commit 3dde520

Browse files
committed
Refactor property requirement check in CommandBaseGenerator
Replaced the nullable annotation check with the IsRequired property on propertySymbol for determining if a field is required. This improves code clarity and aligns with more explicit APIs.
1 parent 36a4920 commit 3dde520

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

new-cli/GitVersion.Cli.Generator/CommandBaseGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private static SettingsPropertyInfo MapToPropertyInfo(IPropertySymbol propertySy
103103
alias = string.Join(", ", aliases);
104104
}
105105

106-
var isRequired = propertySymbol.Type.NullableAnnotation == NullableAnnotation.NotAnnotated;
106+
var isRequired = propertySymbol.IsRequired;
107107
return new()
108108
{
109109
Name = propertySymbol.Name,

0 commit comments

Comments
 (0)