Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log the filename for which an issue is saved #4111

Merged
merged 1 commit into from Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.DEBUG))
.contains(
String.format(
"Saving issue for rule no-all-duplicated-branches on file %s at line 1",
inputFile.absolutePath()
)
);

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