Skip to content

Commit

Permalink
Resolve false positive on use of namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthurvdv committed Nov 13, 2023
1 parent d2ea8b2 commit 4703382
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Design/Rule0003DoNotUseObjectIDsInVariablesOrProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ private void CheckForObjectIDsInVariablesOrProperties(SyntaxNodeAnalysisContext

if (property.PropertyKind != PropertyKind.Permissions && property.PropertyKind != PropertyKind.AccessByPermission)
{
if (ctx.Node.ToString().Trim('"').ToUpper() != property.ValueText.ToUpper())
if (ctx.Node.GetLastToken().ToString().Trim('"').ToUpper() != property.ValueText.ToUpper())
ctx.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0003DoNotUseObjectIDsInVariablesOrProperties, ctx.Node.GetLocation(), new object[] { ctx.Node.ToString().Trim('"'), property.ValueText }));

if (ctx.Node.ToString().Trim('"') != property.ValueText)
if (ctx.Node.GetLastToken().ToString().Trim('"') != property.ValueText)
ctx.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0005VariableCasingShouldNotDIfferFromDeclaration, ctx.Node.GetLocation(), new object[] { property.ValueText, "" }));
}
}
Expand Down

0 comments on commit 4703382

Please sign in to comment.