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

Standalone SonarQube plugin #14

Merged
merged 22 commits into from
Jul 18, 2023
Merged

Standalone SonarQube plugin #14

merged 22 commits into from
Jul 18, 2023

Conversation

utarwyn
Copy link
Member

@utarwyn utarwyn commented Jul 3, 2023

Description

Its time to take the ecoCode JavaScript plugin to the next level! 🚀
The main objective of this PR is to create a standard SonarQube plugin that can be integrated into their marketplace.

Thanks to these changes, both plugins can now run completely independently. Rules are both displayed in the SonarQube interface and reported by ESLint. Boom! 💥

I'm taking the opportunity to move the SonarQube plugin from the main repository.

Changes

  • Create SonarQube plugin (based on SonarJS)
  • Pack ESLint plugin into SonarQube plugin
  • Backport all existing rules into SonarQube plugin
  • Update release process through GitHub Actions
  • Update README
  • Update CONTRIBUTING
  • Add tooling files (copied from main ecoCode repository)

Actual / After

Actual 🐌🐌

Rules are loaded as external rules (more info here), so they are not displayed in the interface. They also can't be enabled/disabled or added to a quality profile. Users must manually install the ESLint plugin inside JS projects and update properties of the analyzer to include the ESLint report.

image

After 🔥🔥

The SonarQube plugin packs everything! No more manual task needed: rules are displayed in the interface like others. ESLint plugin can still be used alone in a project that does not use SonarQube.

image

Related Issues

Resolves #12

@utarwyn utarwyn added the 🚀 enhancement New feature or request label Jul 3, 2023
@utarwyn utarwyn self-assigned this Jul 3, 2023
@utarwyn utarwyn force-pushed the feature-12-sonar-plugin branch 2 times, most recently from f84542d to 6c7fdf3 Compare July 3, 2023 22:09
@utarwyn utarwyn force-pushed the feature-12-sonar-plugin branch from 6c7fdf3 to e405b69 Compare July 3, 2023 22:18
@utarwyn utarwyn marked this pull request as ready for review July 9, 2023 20:38
@utarwyn utarwyn requested review from jycr, glalloue and dedece35 July 9, 2023 20:39
@utarwyn
Copy link
Member Author

utarwyn commented Jul 9, 2023

Here we go, the big rework is finished!

@glalloue @dedece35 if you want to read at least the SonarQube plugin (Java) part 😉
@jycr I have used EC8, EC9, EC11, EC12 and EC13 for existing rule keys but I think we need to talk about it

@jycr
Copy link

jycr commented Jul 9, 2023

@jycr I have used EC8, EC9, EC11, EC12 and EC13 for existing rule keys but I think we need to talk about it

Those identifiers are currently not used. So no problem in my opinion to use these.

jycr added a commit to green-code-initiative/creedengo-rules-specifications that referenced this pull request Jul 9, 2023
@jycr
Copy link

jycr commented Jul 9, 2023

@jycr I have used EC8, EC9, EC11, EC12 and EC13 for existing rule keys but I think we need to talk about it

Those identifiers are currently not used. So no problem in my opinion to use these.

I have added those rules into: green-code-initiative/creedengo-rules-specifications#178

@utarwyn utarwyn requested a review from jycr July 10, 2023 17:28
.github/ISSUE_TEMPLATE/bug_report.md Show resolved Hide resolved
.github/ISSUE_TEMPLATE/feature_request.md Show resolved Hide resolved
.github/ISSUE_TEMPLATE/question.md Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
.github/workflows/publish.yml Show resolved Hide resolved
CONTRIBUTING.md Show resolved Hide resolved
RULES.md Show resolved Hide resolved
sonar-project.properties Show resolved Hide resolved
jycr added a commit to green-code-initiative/creedengo-rules-specifications that referenced this pull request Jul 11, 2023
@jycr
Copy link

jycr commented Jul 11, 2023

@utarwyn : if you want, you can remove rule specification files (in sonar-plugin/src/main/resources/io/ecocode/rules) and use following dependency:

        <dependency>
            <groupId>io.ecocode</groupId>
            <artifactId>ecocode-rules-specifications</artifactId>
            <version>0.0.1</version>
            <classifier>javascript</classifier>
        </dependency>

Also, I think you can make a PR to green-code-initiative/ecoCode project to remove module javascript-plugin

@utarwyn
Copy link
Member Author

utarwyn commented Jul 11, 2023

@jycr
if you want, you can remove rule specification files

Nice idea! Thank you for the artifact, I will try and create a new PR with the change

Also, I think you can make a PR to green-code-initiative/ecoCode project to remove module javascript-plugin

Yes I have planned to remove the javascript-plugin inside ecoCode right after this one will be merged

@utarwyn
Copy link
Member Author

utarwyn commented Jul 11, 2023

@dedece35 I have answered all your remarks/questions I think 😄

@utarwyn utarwyn requested a review from dedece35 July 11, 2023 17:50
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

97.4% 97.4% Coverage
0.0% 0.0% Duplication

Copy link
Member

@dedece35 dedece35 left a comment

Choose a reason for hiding this comment

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

ok for me, now.

jycr added a commit to green-code-initiative/creedengo-rules-specifications that referenced this pull request Jul 16, 2023
@utarwyn utarwyn merged commit 17fc83d into main Jul 18, 2023
@utarwyn utarwyn deleted the feature-12-sonar-plugin branch July 18, 2023 21:16
jycr added a commit to green-code-initiative/creedengo-rules-specifications that referenced this pull request Jul 21, 2023
jycr added a commit to green-code-initiative/creedengo-rules-specifications that referenced this pull request Jul 22, 2023
jycr added a commit to green-code-initiative/creedengo-rules-specifications that referenced this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find a way to display rules in SonarQube interface
3 participants