Skip to content

Commit

Permalink
Fix LogAnalyzerBase UT
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioaversa committed Sep 18, 2023
1 parent bb11351 commit b272354
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -18,6 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

using Microsoft.CodeAnalysis;
using SonarAnalyzer.Protobuf;

namespace SonarAnalyzer.Rules
Expand Down Expand Up @@ -45,7 +46,7 @@ public abstract class LogAnalyzerBase<TSyntaxKind> : UtilityAnalyzerBase<TSyntax

protected sealed override LogInfo CreateMessage(SyntaxTree tree, SemanticModel model, ImmutableSortedSet<LineDirectiveEntry> lineDirectiveMap) =>
tree.IsGenerated(Language.GeneratedCodeRecognizer, model.Compilation)
? new LogInfo { Severity = LogSeverity.Debug, Text = $"File '{syntaxTree.FilePath}' was recognized as generated" }
? CreateMessage(tree)
: null;

private static LogInfo CreateMessage(SyntaxTree tree) =>
Expand Down

0 comments on commit b272354

Please sign in to comment.