Skip to content

Commit

Permalink
Log the filename for which an issue is saved
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource committed Aug 25, 2023
1 parent 74a17ae commit d2579e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Expand Up @@ -175,7 +175,12 @@ private void processParsingError(BridgeServer.ParsingError parsingError) {

private void saveIssues(List<Issue> issues) {
for (Issue issue : issues) {
LOG.debug("Saving issue for rule {} on line {}", issue.ruleId, issue.line);
LOG.debug(
"Saving issue for rule {} on file {} at line {}",
issue.ruleId,
file.absolutePath(),
issue.line
);
saveIssue(issue);
}
}
Expand Down
Expand Up @@ -183,6 +183,13 @@ void should_analyse() throws Exception {
sensor.execute(context);
verify(bridgeServerMock, times(1)).initLinter(any(), any(), any(), any());
assertThat(context.allIssues()).hasSize(expectedResponse.issues.size());
assertThat(logTester.logs(LoggerLevel.ERROR))
.contains(
String.format(
"Saving issue for rule no-all-duplicated-branches on file {} at line 1",
inputFile.absolutePath()
)
);

Iterator<Issue> issues = context.allIssues().iterator();
Issue firstIssue = issues.next();
Expand Down

0 comments on commit d2579e5

Please sign in to comment.