From f474284ab9a4f263e514333e20626b9f7c196864 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 9 Jul 2023 20:43:27 +0200 Subject: [PATCH] fix(spoon): Add logging to spoon analyzer (#808) --- .../laughing_train/services/SpoonAnalyzerService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/github-bot/src/main/java/io/github/martinwitt/laughing_train/services/SpoonAnalyzerService.java b/github-bot/src/main/java/io/github/martinwitt/laughing_train/services/SpoonAnalyzerService.java index e585b268b..3c45ced64 100644 --- a/github-bot/src/main/java/io/github/martinwitt/laughing_train/services/SpoonAnalyzerService.java +++ b/github-bot/src/main/java/io/github/martinwitt/laughing_train/services/SpoonAnalyzerService.java @@ -8,6 +8,7 @@ import jakarta.enterprise.context.ApplicationScoped; import java.io.File; import java.util.List; +import java.util.stream.Collectors; import xyz.keksdose.spoon.code_solver.analyzer.spoon.SpoonBasedAnalyzer; @ApplicationScoped @@ -31,6 +32,14 @@ public CodeAnalyzerResult analyze(AnalyzerRequest request) { File folder = project.project().folder(); SpoonBasedAnalyzer analyzer = new SpoonBasedAnalyzer(); List analyze = analyzer.analyze(folder.toPath()); + logger.atInfo().log( + "Spoon found %s results with the following rules: %s", + analyze.size(), + analyze.stream() + .map(v -> v.ruleID().toString()) + .distinct() + .collect(Collectors.joining(","))); + CodeAnalyzerResult.Success success = new CodeAnalyzerResult.Success(analyze, project.project()); analyzerResultPersistenceService.persistResults(success); return success;