Skip to content

SONARJAVA-4975 Create custom rules plugin around symbolic execution engine#4798

Merged
leonardo-pilastri-sonarsource merged 11 commits intomasterfrom
lp-migrate-se-engine
Jun 5, 2024
Merged

SONARJAVA-4975 Create custom rules plugin around symbolic execution engine#4798
leonardo-pilastri-sonarsource merged 11 commits intomasterfrom
lp-migrate-se-engine

Conversation

@leonardo-pilastri-sonarsource
Copy link
Copy Markdown
Contributor

Please ensure your pull request adheres to the following guidelines:

  • Use the following formatting style: SonarSource/sonar-developer-toolset
  • Unit tests are passing and you provided a unit test for your fix
  • ITs should pass : To run ITs locally, checkout the README of the project.
  • If there is a Jira ticket available, please make your commits and pull request start with the ticket number (SONARJAVA-XXXX)

Comment thread pom.xml
@@ -10,7 +10,7 @@

<groupId>org.sonarsource.java</groupId>
<artifactId>java</artifactId>
<version>7.35.0-SNAPSHOT</version>
<version>7.36.0-SNAPSHOT</version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert back to 7.35

OrchestratorBuilder orchestratorBuilder = Orchestrator.builderEnv()
.useDefaultAdminCredentialsForBuilds(true)
.setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE"))
.setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE[10.3]"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to change this back to LATEST_RELEASE

Comment on lines +101 to +102
.addPlugin(MavenLocation.of("org.sonarsource.sonar-lits-plugin", "sonar-lits-plugin", "0.11.0.2659"))
.addPlugin(FileLocation.of(TestClasspathUtils.findModuleJarPath("../../java-symbolic-execution/java-symbolic-execution-plugin").toFile()));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the symbolic execution plugin right after the Java plugin, for consistency?


}

default void register(RegistrarContext registrarContext, CheckFactory checkFactory) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a javadoc comment here too

Comment thread java-symbolic-execution/java-symbolic-execution-plugin/pom.xml
Comment on lines +84 to +85
.map(repository::rule)
.forEach(rule -> rule.setTemplate(true));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we don't need a separate map invocation here, it seems to me that we can merge the map & the forEach for better readability.

Comment on lines +30 to +31
assertThat(JavaSECheckList.getChecks()).isNotNull();
assertThat(JavaSECheckList.getChecks()).hasSize(23);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can chain these assertions.


@Test
void plugin() {
SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(10, 2), SonarQubeSide.SERVER, SonarEdition.DEVELOPER);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we can't use the community edition here?

@@ -80,7 +66,7 @@ void count() {
count++;
}
}
assertThat(CheckList.getChecks()).hasSize(count + SE_CHEKS.size());
assertThat(CheckList.getChecks()).hasSize(count );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assertThat(CheckList.getChecks()).hasSize(count );
assertThat(CheckList.getChecks()).hasSize(count);

@sonarqube-next
Copy link
Copy Markdown

sonarqube-next Bot commented Jun 5, 2024

@leonardo-pilastri-sonarsource leonardo-pilastri-sonarsource deleted the lp-migrate-se-engine branch June 5, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants