-
Notifications
You must be signed in to change notification settings - Fork 183
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
Update metadata for the external rules #4107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a unit test in the following integration test that asserts that we properly import external issues from a couple of ESLint plugins:
SonarJS/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/EslintReportTest.java
Lines 39 to 56 in 622c9ef
class EslintReportTest { | |
private static final Orchestrator orchestrator = OrchestratorStarter.ORCHESTRATOR; | |
private static final String PROJECT_KEY_PREFIX = "SonarJS-eslint-report-test"; | |
private static final File PROJECT_DIR = TestUtils.projectDir("eslint_report"); | |
@Test | |
void should_save_issues_from_external_report_with_relative_paths() { | |
String projectKey = PROJECT_KEY_PREFIX + "-relative"; | |
SonarScanner build = OrchestratorStarter | |
.createScanner() | |
.setProjectDir(PROJECT_DIR) | |
.setProjectKey(projectKey) | |
.setProjectName(projectKey) | |
.setProjectVersion("1.0") | |
.setSourceDirs("src"); |
Right now, it seems that we are only testing with ESLint core rules given the content of this report:
SonarJS/its/plugin/projects/eslint_report/report.json
Lines 1 to 11 in 622c9ef
[ | |
{ | |
"filePath": "src/file.js", | |
"messages": [ | |
{ | |
"ruleId": "no-unused-vars", | |
"severity": 2, | |
"message": "'addOne' is defined but never used.", | |
"line": 1, | |
"column": 10, | |
"nodeType": "Identifier", |
...avascript-plugin/src/main/java/org/sonar/plugins/javascript/rules/EslintRulesDefinition.java
Outdated
Show resolved
Hide resolved
...avascript-plugin/src/main/java/org/sonar/plugins/javascript/rules/EslintRulesDefinition.java
Outdated
Show resolved
Hide resolved
...avascript-plugin/src/main/java/org/sonar/plugins/javascript/rules/EslintRulesDefinition.java
Show resolved
Hide resolved
sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/eslint/readme
Show resolved
Hide resolved
Added |
SonarQube Quality Gate |
Fixes #3126