Skip to content

Commit

Permalink
put comment in a better position
Browse files Browse the repository at this point in the history
  • Loading branch information
mary-georgiou-sonarsource committed Mar 15, 2023
1 parent 72f13d4 commit d810ff2
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -126,8 +126,10 @@ public bool HasMatchingScope(DiagnosticDescriptor descriptor)
}

private bool FileIsIncludedInAnalysis(SonarLintXmlReader sonarLintXml, string filePath) =>
ProjectConfiguration().ProjectType != ProjectType.Unknown // If ProjectType != 'Unknown' we are in S4NET context and all files are analyzed.
// If ProjectType == 'Unknown' then we are in SonarLint or NuGet context and we need to check if the file has been excluded from analysis through SonarLint.xml.
// If ProjectType != 'Unknown' we are in S4NET context and all files are analyzed.
// If ProjectType == 'Unknown' then we are in SonarLint or NuGet context and
// we need to check if the file has been excluded from analysis through SonarLint.xml.
ProjectConfiguration().ProjectType != ProjectType.Unknown
|| (FileInclusionCache.GetValue(Compilation, _ => new()) is var cache
&& cache.GetOrAdd(filePath, _ => IsFileIncluded(sonarLintXml, filePath)));

Expand Down

0 comments on commit d810ff2

Please sign in to comment.