8000 ACOMMONS-13 Override addQuickFix in IssueBuilders to get more specific issue type by leonardo-pilastri-sonarsource · Pull Request #330 · SonarSource/sonar-analyzer-commons · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ACOMMONS-13 Override addQuickFix in IssueBuilders to get more specific issue type #330

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

Merged
merged 2 commits into from
May 13, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.nio.file.Path;
import javax.annotation.Nullable;
import org.sonarsource.analyzer.commons.checks.verifier.internal.InternalIssueVerifier;
import org.sonarsource.analyzer.commons.checks.verifier.quickfix.QuickFix;

/**
* Example:
Expand Down Expand Up @@ -50,7 +51,7 @@
* verifier.assertNoIssues();
* </pre>
*/
public interface MultiFileVerifier extends QuickfixVerifier {
public interface MultiFileVerifier {

/**
* @param mainSourceFilePath
Expand Down Expand Up @@ -106,6 +107,11 @@ static MultiFileVerifier create(Path mainSourceFilePath, Charset encoding) {
*/
void assertNoIssuesRaised();

/**
* Sets the verifier to ignore expected quick fixes.
*/
MultiFileVerifier withoutQuickFixes();

/**
* Must always call one and only one of: onFile, onLine, onRange
*/
Expand All @@ -132,7 +138,7 @@ interface IssueBuilder {
Issue onRange(int line, int column, int endLine, int endColumn);
}

interface Issue extends QuickfixVerifier.IssueWithQuickfix {
interface Issue {

/**
* @param gap Gap used for the computation of the effort (previously effortToFix)
Expand All @@ -150,6 +156,8 @@ interface Issue extends QuickfixVerifier.IssueWithQuickfix {
*/
Issue addSecondary(Path path, int line, int column, int endLine, int endColumn, @Nullable String message);

Issue addQuickFix(QuickFix quickFix);

}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.nio.file.Path;
import javax.annotation.Nullable;
import org.sonarsource.analyzer.commons.checks.verifier.internal.InternalIssueVerifier;
import org.sonarsource.analyzer.commons.checks.verifier.quickfix.QuickFix;

/**
* Example:
Expand Down Expand Up @@ -50,7 +51,7 @@
* verifier.assertNoIssues();
* </pre>
*/
public interface SingleFileVerifier extends QuickfixVerifier {
public interface SingleFileVerifier {

/**
* @param sourceFilePath
Expand Down Expand Up @@ -136,7 +137,7 @@ interface IssueBuilder {

}

interface Issue extends QuickfixVerifier.IssueWithQuickfix {
interface Issue {

/**
* @param gap Gap used for the computation of the effort (previously effortToFix)
Expand All @@ -153,6 +154,8 @@ interface Issue extends QuickfixVerifier.IssueWithQuickfix {
*/
Issue addSecondary(int line, int column, int endLine, int endColumn, @Nullable String message);

Issue addQuickFix(QuickFix quickFix);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public InternalIssueVerifier addComment(int line, int column, String content, in
return addComment(mainSourceFilePath, line, column, content, prefixLength, suffixLength);
}

@Override
public InternalIssueVerifier withoutQuickFixes() {
verifyQuickFixes = false;
return this;
Expand Down
0