You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer on ecoCode I would like to be informed in the documentation :
Of why @DeprecatedRuleKey is often present on rule implementation : it is for old rules to be linked to their old keys and is not necessary for new rules.
Of the steps to add a rule in ecocode-rules-specifications
mvn clean install
Update the pom.xml of the language plugin with the SNAPSHOT version.
The text was updated successfully, but these errors were encountered:
For a rule that already exists (existing ID) but is not described for the target language:
create a subfolder with the language name
create an ASCIIDOC file in it with the rule description for the chosen language, along with an example of KO code and an example of OK code.
For an example, you can refer to the rule EC31 for java: : ecoCode/ecocode-rules-specifications/src/main/rules/EC31/java/EC31.asciidoc
For a rule that doesn't yet exist, determine an ID (random number between 1000 and 1500) that doesn't yet exist and add a JSON metadata file to describe the rule, its remediation cost, its tags, etc. (take the example of other rules) and add the sub-tree structure from the previous point.
do an mvn install of this project to have the dependency in your local maven cache
ecocode-<lang> : to implement the rule for a target language
in the implementation, don't forget to add the @rule(key = “ECxx”) annotation for Java, PHP, Python (for other languages like HTML, JS, etc ... I don't know)
modify this project's pom.xml (but don't commit it) to target the previous module packaged in the local maven cache
create an mvn package to produce the version of the plugin embedding the implementation and specification of the rule concerned
exemple for ecocode-java/pom.xml : <ecocode-rules-specifications.version>1.5.5-SNAPSHOT</ecocode-rules-specifications.version>
It's ready to be tested in your local instance of SonarQube !
ecoCode-<lang>-test-project : to add a real-life example of an outcome that a sonar analysis should detect
As a developer on ecoCode I would like to be informed in the documentation :
@DeprecatedRuleKey
is often present on rule implementation : it is for old rules to be linked to their old keys and is not necessary for new rules.ecocode-rules-specifications
mvn clean install
pom.xml
of the language plugin with the SNAPSHOT version.The text was updated successfully, but these errors were encountered: