Skip to content

Commit 1a1b7b2

Browse files
committed
Add rule import guide to contribution file
1 parent a05bc1d commit 1a1b7b2

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ This repository contains multiple linters you can contribute to, depending on th
88
for:
99

1010
- JavaScript/TypeScript linter, written as an ESLint plugin\
11-
[Click here to read its dedicated contribution guide](https://github.com/green-code-initiative/ecoCode-linter/blob/main/eslint-plugin/CONTRIBUTING.md)
11+
[Click here to read its dedicated contribution guide](eslint-plugin/CONTRIBUTING.md)
1212
- More to come..

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ the [main ecoCode repository](https://github.com/green-code-initiative/ecoCode/t
1515
> ⚠️ These plugins are in a very early stage and need improvements. Any contribution will be appreciated.
1616
1717
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
18+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/CODE_OF_CONDUCT.md)
19+
[![Sonar Quality gate](https://img.shields.io/sonar/quality_gate/green-code-initiative_ecoCode-linter?server=https%3A%2F%2Fsonarcloud.io)](https://sonarcloud.io/project/overview?id=green-code-initiative_ecoCode-linter)
1820

1921
📣 Why linters?
2022
----------------
@@ -38,7 +40,7 @@ Not available right now. Coming soon!
3840
If you don't want to integrate rules into SonarQube, you are free to do so.\
3941
Plugins are working nicely on their own! Follow instructions in the dedicated README files.
4042

41-
- [JavaScript/TypeScript linter using ESLint](https://github.com/green-code-initiative/ecoCode-linter/blob/main/eslint-plugin/README.md)
43+
- [JavaScript/TypeScript linter using ESLint](eslint-plugin/README.md)
4244
- More to come..
4345

4446
🛒 Distribution
@@ -53,5 +55,5 @@ You can follow changelogs on [GitHub Releases page](https://github.com/green-cod
5355
You have an idea or you want to help us improving these linters? \
5456
We are open to your suggestions and contributions! Open an issue or PR 🚀
5557

56-
Check out the [CONTRIBUTING.md](https://github.com/green-code-initiative/ecoCode-linter/blob/main/CONTRIBUTING.md) file
58+
Check out the [CONTRIBUTING.md](CONTRIBUTING.md) file
5759
and follow the various guides to start contributing.

eslint-plugin/CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,20 @@ Two npm scripts are available:
7474

7575
All the generated code is between commented lines with "auto-generated" in the text.\
7676
**Please run update script** after a rule creation.
77+
78+
## Import a rule into the SonarQube plugin
79+
80+
After being developed in the linter, a rule must be integrated into the SonarQube plugin in order to be displayed
81+
correctly with all its details. A tooling script makes this job very easy.
82+
83+
1. Run the npm script `yarn run generate-sonar-rules`
84+
2. A file will be created at **"tools/generated-rules.json"**, copy its content
85+
3. Paste it into ecoCode project in file
86+
**"javascript-plugin/src/main/resources/fr/greencodeinitiative/i10n/javascript/rules.json"**
87+
88+
## End of development?
89+
90+
The last step is to open a PR on this project with the implementation of the rule, and a second one on the ecoCode
91+
project with the list of updated rules. Keep an eye on the coverage of your rule implementation 👀
92+
93+
This is the end of this guide, thank you for reading this far and contributing to the project 🙏.

0 commit comments

Comments
 (0)