diff --git a/doc/CODE_OF_CONDUCT.md b/doc/CODE_OF_CONDUCT.md index 73156de..e401188 100644 --- a/doc/CODE_OF_CONDUCT.md +++ b/doc/CODE_OF_CONDUCT.md @@ -1,4 +1,4 @@ -# Code of Conduct - EcoCode +# Code of Conduct - Creedengo - [Our Pledge](#our-pledge) - [Our Standards](#our-standards) @@ -63,7 +63,7 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement with [form contact](https://www.ecocode.io/contact). +reported to the community leaders responsible for enforcement with [form contact](https://green-code-initiative.org/). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/doc/CODE_STYLE.md b/doc/CODE_STYLE.md index 58d6722..74f8ff9 100644 --- a/doc/CODE_STYLE.md +++ b/doc/CODE_STYLE.md @@ -1,4 +1,5 @@ -# Code Style Guide - EcoCode +# Code Style Guide - Creedengo + - [Introduction](#introduction) - [Source File Basics](#source-file-basics) @@ -255,7 +256,7 @@ The use of `var` for variable declarations (_local variable type inference_) is #### Protections against ClassCast exceptions -From experience with issue [#42](https://github.com/green-code-initiative/ecoCode/issues/42), when an exception occurs during Sonar analysis with maven command, the consequence is a crash. If this phase is launched in a CI/CD pipeline, this crash will block the pipeline. Thus, our plugins will be deleted until next corrections. +From experience with issue [#42](https://github.com/green-code-initiative/creedengo-rules-specifications/issues/42), when an exception occurs during Sonar analysis with maven command, the consequence is a crash. If this phase is launched in a CI/CD pipeline, this crash will block the pipeline. Thus, our plugins will be deleted until next corrections. Please, make a maximum of controls in the code to avoid ClassCast exceptions and thus, avoid uninstalling our plugin from SonarQube. diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index fdb0f5d..2c8cd43 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing - EcoCode +# Contributing - Creedengo - [Code of Conduct](#code-of-conduct) - [I Have a Question](#i-have-a-question) @@ -88,7 +88,7 @@ When you create an issue, a template is given to you to help you filling it. ### Suggesting Enhancements -This section guides you through submitting an enhancement suggestion for Ecocode repositories, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. +This section guides you through submitting an enhancement suggestion for creedengo repositories, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. #### Before Submitting an Enhancement @@ -105,14 +105,14 @@ Enhancement suggestions are tracked as GitHub issues. - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and ["silentcast" tool](https://github.com/colinkeenan/silentcast) or ["byzanz" tool](https://github.com/GNOME/byzanz) on Linux. -- **Explain why this enhancement would be useful** to most Ecocode users. You may also want to point out the other projects that solved it better and which could serve as inspiration. +- **Explain why this enhancement would be useful** to most creedengo users. You may also want to point out the other projects that solved it better and which could serve as inspiration. When you create an issue, a template is given to you. ### How Do I Suggest a New Rule ? - first of all, check if rule isn't existing yet (in `RULES.md` or in Sonarqube native rules list) -- if it isn't exist, create a new issue in `ecocode` repository : choose `new rule template` +- if it isn't exist, create a new issue in `creedengo-rules-specifications` repository : choose `new rule template` - fill the template and submit issue ### Your First Code Contribution diff --git a/doc/FAQ.md b/doc/FAQ.md index 1d76263..2545e0b 100644 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -1,13 +1,13 @@ Frequently Ask Questions --- -## I'm using default `Sonar Way` rules (with default `Sonar Way` profile). When I install one of ecoCode plugins (ex : `ecoCode-java plugin`), are new ecoCode rules installed ? and how does the plugin do this ? +## I'm using default `Sonar Way` rules (with default `Sonar Way` profile). When I install one of creedengo plugins (ex : `creedengo-java plugin`), are new creedengo rules installed ? and how does the plugin do this ? -> When an ecoCode plugin is installed by the marketplace, the rules are immediately available on SonarQube. You can find them if you go to "rules" tab, and select rules with tag `ecocode`. +> When an creedengo plugin is installed by the marketplace, the rules are immediately available on SonarQube. You can find them if you go to "rules" tab, and select rules with tag `creedengo`. > -> But by default, ecoCode rules aren't set to an existing Sonarqube profile. +> But by default, creedengo rules aren't set to an existing Sonarqube profile. > -> If you want to use ecoCode rules (for one language for example), you have many ways to configure it : -> 1. create a new profile, then select all wanted rules (ecoCode rules or not) for that new profile, and finally use this new profile as "default" profile for the selected language (or set a few projects to this new profile). -> 2. use our script to create ths kind of profile (explanation here : https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/HOWTO.md#initialize-default-profiles-for-ecocode-plugins) ... WARNING : the new profile created will be set as the default profile for your language ! -> 3. update one of your current profiles you use with new available ecoCode rules \ No newline at end of file +> If you want to use creedengo rules (for one language for example), you have many ways to configure it : +> 1. create a new profile, then select all wanted rules (creedengo rules or not) for that new profile, and finally use this new profile as "default" profile for the selected language (or set a few projects to this new profile). +> 2. use our script to create ths kind of profile (explanation here : https://github.com/green-code-initiative/creedengo-common/blob/main/doc/HOWTO.md#initialize-default-profiles-for-creedengo-plugins) ... WARNING : the new profile created will be set as the default profile for your language ! +> 3. update one of your current profiles you use with new available creedengo rules \ No newline at end of file diff --git a/doc/HOWTO.md b/doc/HOWTO.md index 0e0b4bb..80456cd 100644 --- a/doc/HOWTO.md +++ b/doc/HOWTO.md @@ -1,7 +1,7 @@ - [Global Requirements](#global-requirements) - [DEVELOPMENT](#development) - [Installing Local environment (local SonarQube)](#installing-local-environment-local-sonarqube) - - [HOWTO build the SonarQube ecoCode plugins](#howto-build-the-sonarqube-ecocode-plugins) + - [HOWTO build the SonarQube creedengo plugins](#howto-build-the-sonarqube-creedengo-plugins) - [Requirements](#requirements) - [Build the code](#build-the-code) - [HOWTO install SonarQube dev environment](#howto-install-sonarqube-dev-environment) @@ -11,7 +11,7 @@ - [Change password](#change-password) - [Check plugins installation](#check-plugins-installation) - [Generate access token](#generate-access-token) - - [Initialize default profiles for `ecocode` plugins](#initialize-default-profiles-for-ecocode-plugins) + - [Initialize default profiles for `creedengo` plugins](#initialize-default-profiles-for-creedengo-plugins) - [HOWTO reinstall SonarQube (if needed)](#howto-reinstall-sonarqube-if-needed) - [HOWTO start or stop service (already installed)](#howto-start-or-stop-service-already-installed) - [HOWTO install new plugin version](#howto-install-new-plugin-version) @@ -31,7 +31,7 @@ - [HOWTO publish new release on SonarQube Marketplace](#howto-publish-new-release-on-sonarqube-marketplace) - [New release from scratch](#new-release-from-scratch) - [New release of existing plugin](#new-release-of-existing-plugin) - - [HOWTO publish a new version of ecocode-rules-specifications on Maven Central](#howto-publish-a-new-version-of-ecocode-rules-specifications-on-maven-central) + - [HOWTO publish a new version of creedengo-rules-specifications on Maven Central](#howto-publish-a-new-version-of-creedengo-rules-specifications-on-maven-central) - [Requirements](#requirements-2) - [Maven Central publish process](#maven-central-publish-process) - [HOWTO configure publish process on Maven Central (core-contributor rights needed)](#howto-configure-publish-process-on-maven-central-core-contributor-rights-needed) @@ -59,11 +59,11 @@ ## Installing Local environment (local SonarQube) -### HOWTO build the SonarQube ecoCode plugins +### HOWTO build the SonarQube creedengo plugins #### Requirements -check requirements : https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/starter-pack.md#requirements +check requirements : https://github.com/green-code-initiative/creedengo-common/blob/main/doc/starter-pack.md#requirements #### Build the code @@ -125,7 +125,7 @@ sysctl -w vm.max_map_count=262144 #### Configuration SonarQube -*Purposes* : Configure SonarQube to have all ecocode plugins rules enabled by default. +*Purposes* : Configure SonarQube to have all creedengo plugins rules enabled by default. ##### Change password @@ -138,7 +138,7 @@ sysctl -w vm.max_map_count=262144 - go to "Adminitration" tab - go to "Marketplace" sub-tab - go bottom, and clic on "Installed" sub-tab -- check here, if you have ecoCode plugins displayed with a SNAPSHOT version +- check here, if you have creedengo plugins displayed with a SNAPSHOT version ##### Generate access token @@ -149,9 +149,9 @@ When you are connected, generate a new token on `My Account -> Security -> Gener Instead of login+password authentication, this token can now be used as value for `sonar.login` variable when needed (examples : call sonar scanner to send metrics to SonarQube, on use internal tools, ...) -##### Initialize default profiles for `ecocode` plugins +##### Initialize default profiles for `creedengo` plugins -- use tool `install_profile.sh` in `ecocode-common` repository (inside directory `tools/rules_config`) +- use tool `install_profile.sh` in `creedengo-common` repository (inside directory `tools/rules_config`) - if you want, you can check default configuration of this tool in `_config.sh` file - launch followed command : `./install_profile.sh ` @@ -267,7 +267,7 @@ This step is done on next release of plugin (example : version N). 1. Upgrade the rule implementation to add deprecation information : in plugin repository containing the rule implementation, add a new `@DeprecatedRule` annotation on the rule class 2. Upgrade rules documentation 1. in plugin repository containing the rule implementation, in `RULES.md` file, move rule line from standard rules array to deprecated rules array - 2. in `ecoCode-rules-specification` repository, add deprecation to current rule + 2. in `creedengo-rules-specification` repository, add deprecation to current rule Thus in next release of plugin, the rule will be still present but displayed as deprecated in SonarQube UI. @@ -302,7 +302,7 @@ mvn license:format ### Create a release on DYNAMIC versionning system module -This is the use case for `ecocode` repository +This is the use case for `creedengo-rules-specifications` repository 1. **upgrade `CHANGELOG.md`** : add release notes for next release 1. **Replace `Unreleased` title** with the new version like `Release X.Y.Z` and the date @@ -321,7 +321,7 @@ This is the use case for `ecocode` repository ### Create a release on STATIC versionning system module -This is the use case for all plugin repositories except `ecocode` repository +This is the use case for all plugin repositories except `creedengo` repository 1. IF **new release wanted** is a **major** or **minor** version (`X` or `Y` in `X.Y.Z`) 1. **THEN** **modify the old version** to the new version in **all XML/YML files** @@ -358,7 +358,7 @@ This is the use case for all plugin repositories except `ecocode` repository 1. Create a fork of [SonarSource/sonar-update-center-properties](https://github.com/SonarSource/sonar-update-center-properties.git) and clone it locally 2. Create a new branch -3. Change corresponding plugin metadata file (for `ecocode-java`: [ecocodejava.properties](https://github.com/SonarSource/sonar-update-center-properties/blob/master/ecocodejava.properties), for `ecocode-php`: [ecocodephp.properties](https://github.com/SonarSource/sonar-update-center-properties/blob/master/ecocodephp.properties), for `ecocode-python`: [ecocodepython.properties](https://github.com/SonarSource/sonar-update-center-properties/blob/master/ecocodepython.properties)): +3. Change corresponding plugin metadata file (for `creedengo-java`: [creedengojava.properties](https://github.com/SonarSource/sonar-update-center-properties/blob/master/ecocodejava.properties), for `creedengo-php`: [creedengophp.properties](https://github.com/SonarSource/sonar-update-center-properties/blob/master/ecocodephp.properties), for `creedengo-python`: [creedengopython.properties](https://github.com/SonarSource/sonar-update-center-properties/blob/master/ecocodepython.properties)): - Append new version to `publicVersions` value (comma separated value) - Add following properties (where `X.X.X` is new release to publish): - `X.X.X.description`: a summary of main changes for user for this version @@ -393,20 +393,20 @@ Examples : - documentation : [README.md](https://github.com/SonarSource/sonar-update-center-properties/blob/master/README.md) - example : [PR example](https://github.com/SonarSource/sonar-update-center-properties/pull/468) -## HOWTO publish a new version of ecocode-rules-specifications on Maven Central +## HOWTO publish a new version of creedengo-rules-specifications on Maven Central ### Requirements You need write rights to use Maven Central publish process (mainteners or core-team members). -**Create a new release of `ecoCode` repository** : please see above [HOWTO create a release](#howto-create-a-release-core-contributor-rights-needed). +**Create a new release of `creedengo` repository** : please see above [HOWTO create a release](#howto-create-a-release-core-contributor-rights-needed). Why create a new release before ? -Because publish process of `ecocode-rules-specifications` on Maven Central needs a tag on `ecoCode` repository. +Because publish process of `creedengo-rules-specifications` on Maven Central needs a tag on `creedengo` repository. ### Maven Central publish process -- go to "Action" tab of `ecoCode` reposiroty +- go to "Action" tab of `creedengo-rules-specifications` repository - click on "Publish to Maven Central" workflow - click on "Run workflow" list button - choose a tag version (and not a branch because SNAPSHOT version won't be published on Maven Central) @@ -424,26 +424,26 @@ Because publish process of `ecocode-rules-specifications` on Maven Central needs `OSSRH_TOKEN` and `OSSRH_USERNAME` are used for communication between Github and Sonatype Nexus system for publish process to Maven Central. Nexus URL : https://s01.oss.sonatype.org/ -These variables are stored in Github Secrets available `Settings` tab of `ecoCode` repository, in `Secrets and variables` sub-tab, in `Actions` sub-section. +These variables are stored in Github Secrets available `Settings` tab of `creedengo` repository, in `Secrets and variables` sub-tab, in `Actions` sub-section. #### Why change these variables ? Values are get from a specific Sonatype Nexus account. -Actually, `ecoCode` Sonatype Nexus account was used to generate values corresponding to `OSSRH_TOKEN` and `OSSRH_USERNAME` variables. +Actually, `creedengo` Sonatype Nexus account was used to generate values corresponding to `OSSRH_TOKEN` and `OSSRH_USERNAME` variables. If we want use another account, we need to change these values by generating new ones on this new account. #### How to generate new values and update Github Secrets ? 1. Go to [Sonatype Nexus](https://oss.sonatype.org/) -2. Login with account (ex : `ecoCode`) +2. Login with account (ex : `creedengo`) 3. Go to `Profile` tab 4. Go to `User Token` sub-tab present in top list (`Summary` value is selected by default) 5. Click on `Access User Token` button 6. New values will be generated and displayed -7. Copy these values and paste them in Github Secrets in `ecoCode` repository, respectively in `OSSRH_TOKEN` variable (the password) and `OSSRH_USERNAME` variable (the username) -8. Check publish process with a new release version (see above [HOWTO configure publish process on Maven Central](#howto-publish-a-new-version-of-ecocode-rules-specifications-on-maven-central)) +7. Copy these values and paste them in Github Secrets in `creedengo` repository, respectively in `OSSRH_TOKEN` variable (the password) and `OSSRH_USERNAME` variable (the username) +8. Check publish process with a new release version (see above [HOWTO configure publish process on Maven Central](#howto-publish-a-new-version-of-creedengo-rules-specifications-on-maven-central)) ### Update GPG Maven Central keys @@ -452,7 +452,7 @@ If we want use another account, we need to change these values by generating new GPG system is used to sign JAR files before publishing them to Maven Central. We have to generate public and private keys, and store them in Github Secrets with `MAVEN_GPG_PRIVATE_KEY` and `MAVEN_GPG_PASSPHRASE` variables. -These GPG keys are stored in Github Secrets available `Settings` tab of `ecoCode` repository, in `Secrets and variables` sub-tab, in `Actions` sub-section. +These GPG keys are stored in Github Secrets available `Settings` tab of `creedengo-rules-specifications` repository, in `Secrets and variables` sub-tab, in `Actions` sub-section. Values are generated on local machine with "gpg" command line tool. @@ -503,16 +503,16 @@ If we want to upgrade these keys, we need to generate new ones and reconfigure G 5. Open this local file and copy content (only content between `-----BEGIN PGP PRIVATE KEY BLOCK-----` and `-----END PGP PRIVATE KEY BLOCK-----` included) 6. Paste this content in `MAVEN_GPG_PRIVATE_KEY` variable in Github Secrets 7. If you changed the passphrase in first step, paste it in `MAVEN_GPG_PASSPHRASE` variable in Github Secrets -8. Check publish process with a new release version (see above [HOWTO configure publish process on Maven Central](#howto-publish-a-new-version-of-ecocode-rules-specifications-on-maven-central)) +8. Check publish process with a new release version (see above [HOWTO configure publish process on Maven Central](#howto-publish-a-new-version-of-creedengo-rules-specifications-on-maven-central)) # CONTACT ## HOWTO contact the team Several ways existing : -- go to our website https://ecocode.io/#/ and choose one of different ways : +- go to our website https://green-code-initiative.org/# and choose one of different ways : - on of our 3 social media (top-right menu) - - go to "entreprise" page and you can fill a contact form : https://ecocode.io/#/entreprise + - go to "entreprise" page and you can fill a contact form : https://green-code-initiative.org/#/entreprise - technically : got to our github and create an issue or a discussion - https://github.com/green-code-initiative diff --git a/doc/starter-pack.md b/doc/starter-pack.md index eb4d6f8..42641de 100644 --- a/doc/starter-pack.md +++ b/doc/starter-pack.md @@ -28,7 +28,7 @@ # Basic Explanations -In order to develop a Sonarqube Plugin in Open source for ecocode, two basics should have been understood : +In order to develop a Sonarqube Plugin in Open source for creedengo, two basics should have been understood : - How to develop a Sonarqube plugin - Understand and work with the Gitflow @@ -37,7 +37,7 @@ In order to develop a Sonarqube Plugin in Open source for ecocode, two basics sh ## Sonarqube Plugin Here is official documentation to understand how to develop a sonar plugin : -But ... we are going to help you more specifically for `ecoCode` project in following sections. +But ... we are going to help you more specifically for `creedengo` project in following sections. ### How a SonarQube plugin works @@ -46,7 +46,7 @@ For example, you’ll be able to access of all the `for` loops, to explore conte To better understand AST structure, you can use the [AST Explorer](https://astexplorer.net/) and select the language of the code you want to explore. -The JavaScript Sonar plugin works differently because it doesn't parse the code to transform it into an AST itself, it use the ESLint engine which will do it itself ([More information here](https://github.com/green-code-initiative/ecoCode-javascript/blob/main/CONTRIBUTING.md)). The good part is that it means that all Ecocode JavaScript rules are made available both to Sonar and to [ESLint](https://eslint.org/) through an [Ecocode ESLint plugin](https://www.npmjs.com/package/@ecocode/eslint-plugin). +The JavaScript Sonar plugin works differently because it doesn't parse the code to transform it into an AST itself, it use the ESLint engine which will do it itself ([More information here](https://github.com/green-code-initiative/ecoCode-javascript/blob/main/CONTRIBUTING.md)). The good part is that it means that all Creedengo JavaScript rules are made available both to Sonar and to [ESLint](https://eslint.org/) through an [Creedengo ESLint plugin](https://www.npmjs.com/package/@ecocode/eslint-plugin). ## Gitflow @@ -57,7 +57,7 @@ please check following section ## Github Green-Code-Initiative -- common part (doc / tools) : +- common part (doc / tools) : - rules specification : - several mobile repositories - several standard repositories @@ -98,7 +98,7 @@ For Windows OS : - execute script : `./check_requirements.bat` - then check versions displayed -PS : if you have some problems with this script, please feel free to create a new issue here +PS : if you have some problems with this script, please feel free to create a new issue here ### Method 2 - Manual check (if above "method 1" doesn't work) @@ -121,20 +121,20 @@ Clone the project with (standard, mobile or/and common) : please see all availab Example for Java plugin (with SSH) : ```sh -git clone git@github.com:green-code-initiative/ecoCode-java.git +git clone git@github.com:green-code-initiative/creedengo-java.git ``` -*WARNING* : if you are a new contributor (an not identified project `maintainer`), you have to use FORK / Pull Request System like explained here +*WARNING* : if you are a new contributor (an not identified project `maintainer`), you have to use FORK / Pull Request System like explained here ## Start local environment You will find all steps to start and configure your local Sonarqube dev Environment here : -- 1st step - build your local plugin: -- 2nd step - launch local Sonarqube (with installation of previous local plugin built) : -- 3rd step - check that local environment is running perfectly : choose one of repositories with suffix "test-project" (ex : ) +- 1st step - build your local plugin: +- 2nd step - launch local Sonarqube (with installation of previous local plugin built) : +- 3rd step - check that local environment is running perfectly : choose one of repositories with suffix "test-project" (ex : ) - next, launch script `tool_send_to_sonar.sh` (using previous secruitty token created on the first step) - - finally, open local SonarQube GUI () to verify if alone project raises ecoCode errors + - finally, open local SonarQube GUI () to verify if alone project raises creedengo errors # Implement a new rule @@ -168,13 +168,13 @@ Many ways to do this : For a new rule implementation, we strongly recommend you to follow this check-list : -- [ ] Check if rule doesn't exist in our referential rules list yet (`RULES.md` file or `ecocode-rules-specifications` module in `ecoCode` repository) -- [ ] Create PR on the `ecocode` repository to add the new rule definition (`ecocode-rules-specifications`) +- [ ] Check if rule doesn't exist in our referential rules list yet (`RULES.md` file or `creedengo-rules-specifications` module in `creedengo` repository) +- [ ] Create PR on the `creedengo` repository to add the new rule definition (`creedengo-rules-specifications`) - [ ] To choose the new rule id : - - [ ] if rule is already existing in `RULES.md` file or in `ecocode-rules-specifications` module, please use the given rule id - - [ ] if rule doesn't already exist in `RULES.md` file or in `ecocode-rules-specifications` module, please use a random number between 1000 and 1500 (ex : "EC1289") and use it (later, you will be asked to change it) - - [ ] You can use SNAPSHOT version of `ecocode-rules-specifications` during your local rule implementation to go forward -- [ ] Implement rule in your local specific language repository with a reference to local SNAPSHOT of `ecocode-rules-specifications` module (previously, install it locally with maven command) + - [ ] if rule is already existing in `RULES.md` file or in `creedengo-rules-specifications` module, please use the given rule id + - [ ] if rule doesn't already exist in `RULES.md` file or in `creedengo-rules-specifications` module, please use a random number between 1000 and 1500 (ex : "EC1289") and use it (later, you will be asked to change it) + - [ ] You can use SNAPSHOT version of `creedengo-rules-specifications` during your local rule implementation to go forward +- [ ] Implement rule in your local specific language repository with a reference to local SNAPSHOT of `creedengo-rules-specifications` module (previously, install it locally with maven command) - [ ] Write Unit tests (and maximize code coverage) - [ ] Update `RULES.md` file - [ ] Update `CHANGELOG.md` file (inside `Unreleased` section) @@ -233,5 +233,5 @@ Here is the SonarQube : , move it from the "In Progress" column to the "Done" column. +Once your PR is validated, your rule integrates creedengo. In , move it from the "In Progress" column to the "Done" column. Well done. diff --git a/tools/rules_config/README.md b/tools/rules_config/README.md index 2083a1f..3e7c226 100644 --- a/tools/rules_config/README.md +++ b/tools/rules_config/README.md @@ -7,11 +7,11 @@ Add one new tag to a list of rules from `SONAR_RULES_REUSED.md` (using SonarQube API). Why ? because maybe some original SonarQube rules are already ready for being part of this plugin -### EcoCode Quality Profile +### Creedengo Quality Profile Add one new Profile by language inherited from SonarWay (using SonarQube API). Why ? -- we must create a custom Profile to use new eco-design rules from ecocode plugins +- we must create a custom Profile to use new eco-design rules from creedengo plugins - the new profile is inherited from SonarWay to keep natives SonarWay rules also The script attach the new rules with the new quality profile. The new profile becomes the default profile for the language. @@ -29,7 +29,7 @@ The new profile becomes the default profile for the language. - name of tag to add (`TAG_ECODESIGN` variable) : the name of the new tag to add to a list of rules - file path to `SONAR_RULES_REUSED.md` (`FILEPATH_SONAR_RULES_REUSED` variable) : filepath in the local folder. Contains all rules. - name of profile to add (`PROFILE_ECODESIGN` variable) : the name of the new profile to add for each language - - language keys list (string format separated with one comma) (`PROFILES_LANGUAGE_KEYS` variable) : specify here the list of all keys language that you want to add the new ecocode quality profile + - language keys list (string format separated with one comma) (`PROFILES_LANGUAGE_KEYS` variable) : specify here the list of all keys language that you want to add the new creedengo quality profile - profiles set as default (`IS_PROFILE_ECODESIGN_DEFAULT` variable) : 1 if we want to set created profiles as default profile for each language, 0 if we don't want ## Local develop Environment diff --git a/tools/rules_config/_config.sh b/tools/rules_config/_config.sh index 32a421a..51e0a29 100755 --- a/tools/rules_config/_config.sh +++ b/tools/rules_config/_config.sh @@ -25,7 +25,7 @@ SONAR_TOKEN=$2 SONAR_URL=http://localhost:$SONAR_PORT # new tag to add to rules (tagging tools) or to use for rules added to new profiles created (install_profile tool) -TAG_ECODESIGN=ecocode +TAG_ECODESIGN=creedengo ##### @@ -36,7 +36,7 @@ TAG_ECODESIGN=ecocode FILEPATH_SONAR_RULES_REUSED='./SONAR_RULES_REUSED.md' # name quality profile to create with "install_profile.sh" tool -PROFILE_ECODESIGN="EcoCodeProfile" +PROFILE_ECODESIGN="CreedengoProfile" # programming languages list to create with "install_profile.sh" tool PROFILES_LANGUAGE_KEYS=php,py,java,cs diff --git a/tools/rules_config/_core.sh b/tools/rules_config/_core.sh index 4734a73..9aeb966 100755 --- a/tools/rules_config/_core.sh +++ b/tools/rules_config/_core.sh @@ -127,7 +127,7 @@ function change_parent_profile_sonarapi(){ ### $1 : language ### $2 : key quality Profile ### $3 : tags list in string format separated by comma -function activate_rules_ecocode_profile_sonarapi(){ +function activate_rules_creedengo_profile_sonarapi(){ echo $(curl -u $SONAR_TOKEN: --request POST "$SONAR_URL/api/qualityprofiles/activate_rules?languages=$1&targetKey=$2&tags=$3" 2>/dev/null) } diff --git a/tools/rules_config/install_profile.sh b/tools/rules_config/install_profile.sh index eb76c6f..425cb6e 100755 --- a/tools/rules_config/install_profile.sh +++ b/tools/rules_config/install_profile.sh @@ -36,7 +36,7 @@ do key_profile=$(echo "$res_json" | jq -r '.profiles[].key') debug "Activate rules for language '$language' and key profile '$key_profile'" - activate_rules_ecocode_profile_sonarapi "$language" "$key_profile" "$TAG_ECODESIGN" + activate_rules_creedengo_profile_sonarapi "$language" "$key_profile" "$TAG_ECODESIGN" if [ $IS_PROFILE_ECODESIGN_DEFAULT == 1 ]; then debug "Set '$PROFILE_ECODESIGN' profile for language '$language' to Default"