Use CSharpier

This commit is contained in:
Tyrrrz
2023-08-22 21:20:04 +03:00
parent a4726fcefd
commit 21b601da66
99 changed files with 975 additions and 1163 deletions

View File

@@ -12,14 +12,14 @@ public class OptionMustBeRequiredIfPropertyRequiredAnalyzer : AnalyzerBase
public OptionMustBeRequiredIfPropertyRequiredAnalyzer()
: base(
"Options bound to required properties cannot be marked as non-required",
"This option cannot be marked as non-required because it's bound to a required property.")
{
}
"This option cannot be marked as non-required because it's bound to a required property."
) { }
private void Analyze(
SyntaxNodeAnalysisContext context,
PropertyDeclarationSyntax propertyDeclaration,
IPropertySymbol property)
IPropertySymbol property
)
{
if (property.ContainingType is null)
return;
@@ -34,11 +34,7 @@ public class OptionMustBeRequiredIfPropertyRequiredAnalyzer : AnalyzerBase
if (option.IsRequired != false)
return;
context.ReportDiagnostic(
CreateDiagnostic(
propertyDeclaration.Identifier.GetLocation()
)
);
context.ReportDiagnostic(CreateDiagnostic(propertyDeclaration.Identifier.GetLocation()));
}
public override void Initialize(AnalysisContext context)
@@ -46,4 +42,4 @@ public class OptionMustBeRequiredIfPropertyRequiredAnalyzer : AnalyzerBase
base.Initialize(context);
context.HandlePropertyDeclaration(Analyze);
}
}
}