From e09917e0efcf50136dada285fbf362785064e093 Mon Sep 17 00:00:00 2001 From: utarwyn Date: Tue, 19 Nov 2024 23:40:27 +0100 Subject: [PATCH] Move to Creedengo --- .github/ISSUE_TEMPLATE/bug-report.yml | 8 +-- .github/ISSUE_TEMPLATE/config.yml | 4 +- .github/ISSUE_TEMPLATE/feature-request.yml | 4 +- .github/workflows/publish.yml | 6 +-- .github/workflows/release.yml | 8 +-- CHANGELOG.md | 1 + CONTRIBUTING.md | 16 +++--- README.md | 44 +++++++--------- RULES.md | 2 +- docker-compose.yml | 10 ++-- eslint-plugin/.eslintrc.js | 4 +- eslint-plugin/README.md | 39 +++++++-------- eslint-plugin/docs/license-header.txt | 4 +- .../docs/rules/avoid-brightness-override.md | 2 +- .../docs/rules/avoid-css-animations.md | 2 +- .../rules/avoid-high-accuracy-geolocation.md | 2 +- .../docs/rules/limit-db-query-results.md | 2 +- .../rules/no-empty-image-src-attribute.md | 2 +- .../docs/rules/no-import-all-from-library.md | 2 +- .../rules/no-multiple-access-dom-element.md | 2 +- .../docs/rules/no-multiple-style-changes.md | 2 +- eslint-plugin/docs/rules/no-torch.md | 2 +- .../prefer-collections-with-pagination.md | 2 +- .../rules/prefer-shorthand-css-notations.md | 2 +- eslint-plugin/docs/rules/provide-print-css.md | 2 +- eslint-plugin/lib/rule-list.js | 4 +- .../lib/rules/avoid-brightness-override.js | 4 +- .../lib/rules/avoid-css-animations.js | 4 +- .../rules/avoid-high-accuracy-geolocation.js | 4 +- .../lib/rules/limit-db-query-results.js | 4 +- .../lib/rules/no-empty-image-src-attribute.js | 4 +- .../lib/rules/no-import-all-from-library.js | 4 +- .../rules/no-multiple-access-dom-element.js | 4 +- .../lib/rules/no-multiple-style-changes.js | 4 +- eslint-plugin/lib/rules/no-torch.js | 4 +- .../prefer-collections-with-pagination.js | 4 +- .../rules/prefer-shorthand-css-notations.js | 4 +- eslint-plugin/lib/rules/provide-print-css.js | 4 +- eslint-plugin/lib/sonar.js | 8 +-- eslint-plugin/lib/standalone.js | 10 ++-- eslint-plugin/package.json | 10 ++-- eslint-plugin/tests/lib/rule-list.test.js | 4 +- .../lib/rules/avoid-brightness-override.js | 4 +- .../tests/lib/rules/avoid-css-animations.js | 4 +- .../rules/avoid-high-accuracy-geolocation.js | 4 +- .../tests/lib/rules/limit-db-query-results.js | 4 +- .../lib/rules/no-empty-image-src-attribute.js | 4 +- .../lib/rules/no-import-all-from-library.js | 4 +- .../rules/no-multiple-access-dom-element.js | 4 +- .../lib/rules/no-multiple-style-changes.js | 4 +- eslint-plugin/tests/lib/rules/no-torch.js | 4 +- .../prefer-collections-with-pagination.js | 4 +- .../rules/prefer-shorthand-css-notations.js | 4 +- .../tests/lib/rules/provide-print-css.js | 4 +- eslint-plugin/tests/lib/sonar.test.js | 6 +-- eslint-plugin/tests/lib/standalone.test.js | 6 +-- eslint-plugin/yarn.lock | 4 +- sonar-plugin/pom.xml | 32 ++++++------ .../creedengo}/javascript/CheckList.java | 8 +-- .../javascript/ESLintRulesBundle.java | 8 +-- .../creedengo/javascript/EcoCodeRule.java | 50 +++++++++++++++++++ .../javascript/JavaScriptPlugin.java | 8 +-- .../javascript/JavaScriptRuleRepository.java | 16 +++--- .../javascript/JavaScriptRulesDefinition.java | 29 +++++------ .../javascript/TypeScriptRuleRepository.java | 16 +++--- .../javascript/TypeScriptRulesDefinition.java | 29 +++++------ .../checks/AvoidBrightnessOverride.java | 12 +++-- .../javascript/checks/AvoidCSSAnimations.java | 12 +++-- .../checks/AvoidHighAccuracyGeolocation.java | 14 +++--- .../javascript/checks/LimitDbQueryResult.java | 12 +++-- .../checks/NoEmptyImageSrcAttribute.java | 12 +++-- .../checks/NoImportAllFromLibrary.java | 12 +++-- .../checks/NoMultipleAccessDomElement.java | 12 +++-- .../checks/NoMultipleStyleChanges.java | 12 +++-- .../creedengo}/javascript/checks/NoTorch.java | 12 +++-- .../PreferCollectionsWithPagination.java | 12 +++-- .../checks/PreferShorthandCSSNotations.java | 12 +++-- .../javascript/checks/ProvidePrintCSS.java | 12 +++-- .../profiles/ecocode_javascript_profile.json | 15 ------ .../profiles/ecocode_typescript_profile.json | 6 --- .../profiles/javascript_profile.json | 15 ++++++ .../profiles/typescript_profile.json | 4 ++ .../creedengo}/javascript/CheckListTest.java | 8 +-- .../javascript/ESLintRulesBundleTest.java | 8 +-- .../javascript/JavaScriptPluginTest.java | 6 +-- .../JavaScriptRuleRepositoryTest.java | 8 +-- .../JavaScriptRulesDefinitionTest.java | 8 +-- .../TypeScriptRuleRepositoryTest.java | 8 +-- .../TypeScriptRulesDefinitionTest.java | 8 +-- sonar-project.properties | 2 +- 90 files changed, 407 insertions(+), 353 deletions(-) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/CheckList.java (87%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/ESLintRulesBundle.java (73%) create mode 100644 sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/EcoCodeRule.java rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/JavaScriptPlugin.java (78%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/JavaScriptRuleRepository.java (78%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/JavaScriptRulesDefinition.java (63%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/TypeScriptRuleRepository.java (78%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/TypeScriptRulesDefinition.java (63%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/AvoidBrightnessOverride.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/AvoidCSSAnimations.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/AvoidHighAccuracyGeolocation.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/LimitDbQueryResult.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/NoEmptyImageSrcAttribute.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/NoImportAllFromLibrary.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/NoMultipleAccessDomElement.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/NoMultipleStyleChanges.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/NoTorch.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/PreferCollectionsWithPagination.java (68%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/PreferShorthandCSSNotations.java (70%) rename sonar-plugin/src/main/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/checks/ProvidePrintCSS.java (70%) delete mode 100644 sonar-plugin/src/main/resources/io/ecocode/profiles/ecocode_javascript_profile.json delete mode 100644 sonar-plugin/src/main/resources/io/ecocode/profiles/ecocode_typescript_profile.json create mode 100644 sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/javascript_profile.json create mode 100644 sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/typescript_profile.json rename sonar-plugin/src/test/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/CheckListTest.java (80%) rename sonar-plugin/src/test/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/ESLintRulesBundleTest.java (73%) rename sonar-plugin/src/test/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/JavaScriptPluginTest.java (82%) rename sonar-plugin/src/test/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/JavaScriptRuleRepositoryTest.java (78%) rename sonar-plugin/src/test/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/JavaScriptRulesDefinitionTest.java (83%) rename sonar-plugin/src/test/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/TypeScriptRuleRepositoryTest.java (77%) rename sonar-plugin/src/test/java/{io/ecocode => org/greencodeinitiative/creedengo}/javascript/TypeScriptRulesDefinitionTest.java (83%) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 4681a1f..788a5b5 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,6 +1,6 @@ name: 🐞 Bug Report -description: This form is to report unexpected behavior in ecoCode-javascript. -labels: [ "💉 bug: unconfirmed" ] +description: This form is to report unexpected behavior in creedengo-javascript. +labels: ["💉 bug: unconfirmed"] body: - type: markdown attributes: @@ -40,8 +40,8 @@ body: - type: input id: plugin-version attributes: - label: ecoCode-javascript Version - description: Please provide the version of ecoCode-javascript that you are using. + label: creedengo-javascript Version + description: Please provide the version of creedengo-javascript that you are using. validations: required: true - type: input diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 1a1c3f3..9cd1e24 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - name: Start a Discussion - about: "Start a discussion to share your experience with ecoCode-javascript" - url: https://github.com/green-code-initiative/ecoCode-javascript/discussions/new/choose + about: "Start a discussion to share your experience with creedengo-javascript" + url: https://github.com/green-code-initiative/creedengo-javascript/discussions/new/choose diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index a8588f2..bb977d5 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,6 +1,6 @@ name: ✨ Feature Request -description: This form is to request a new feature in ecoCode-javascript. -labels: [ "🚀 enhancement" ] +description: This form is to request a new feature in creedengo-javascript. +labels: ["🚀 enhancement"] body: - type: textarea id: solution diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f77982c..126a944 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Publish on: push: tags: - - '[0-9]+.[0-9]+.[0-9]+' + - "[0-9]+.[0-9]+.[0-9]+" permissions: packages: write @@ -26,7 +26,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} - registry-url: 'https://registry.npmjs.org' + registry-url: "https://registry.npmjs.org" - name: Install dependencies run: yarn install --immutable @@ -62,7 +62,7 @@ jobs: run: cp LICENSE.md eslint-plugin/ - name: Add scope to package name - run: npx --yes change-package-name @${{ github.repository_owner }}/ecocode-eslint-plugin + run: npx --yes change-package-name @${{ github.repository_owner }}/creedengo-eslint-plugin working-directory: eslint-plugin - name: Configure GitHub Packages registry diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eef9b4f..4b401e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: strategy: - description: 'Strategy of semantic version to apply' + description: "Strategy of semantic version to apply" required: true type: choice options: @@ -37,7 +37,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} - name: Use JDK ${{ env.JDK_VERSION }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{ env.JDK_VERSION }} @@ -94,7 +94,7 @@ jobs: tag_name: ${{ steps.package-version.outputs.version }} body: ${{ steps.extract-release-notes.outputs.release_notes }} token: ${{ secrets.RELEASE_TOKEN }} - files: sonar-plugin/target/ecocode-javascript-plugin-${{ steps.package-version.outputs.version }}.jar + files: sonar-plugin/target/creedengo-javascript-plugin-${{ steps.package-version.outputs.version }}.jar prepare-next-release: name: Prepare next release @@ -108,7 +108,7 @@ jobs: token: ${{ secrets.RELEASE_TOKEN }} - name: Use JDK ${{ env.JDK_VERSION }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{ env.JDK_VERSION }} diff --git a/CHANGELOG.md b/CHANGELOG.md index d7ffec1..1a39ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#39](https://github.com/green-code-initiative/ecoCode-javascript/issues/39) Add rule `@ecocode/avoid-brightness-override` (EC522) - [#41](https://github.com/green-code-initiative/ecoCode-javascript/pull/41) Add rule `@ecocode/no-torch` (EC530) +- Rename plugin to creedengo-javascript - Add support for SonarQube up to 10.7 ### Changed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6b6a53a..fefea9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,9 @@ ## Hello! We are pleased to see you here 👋 Please read -common [CONTRIBUTING.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/CONTRIBUTING.md) -in `ecoCode-common` repository first.\ -Also check the [starter pack](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/starter-pack.md) to +common [CONTRIBUTING.md](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/CONTRIBUTING.md) +in `creedengo-common` repository first.\ +Also check the [starter pack](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/starter-pack.md) to have the basic information before starting. ## Structure @@ -49,9 +49,9 @@ But it can be useful to prepare a test project to check the correct execution of ### Before starting -Before even starting to implement the rule, it must have been discussed, mesured and documented in the ecoCode +Before even starting to implement the rule, it must have been discussed, mesured and documented in the Creedengo referential. Please follow -the [dedicated documentation](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/README.md) +the [dedicated documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/README.md#creedengo-rules-specification-repository) to find out how to proceed. ### In the ESLint plugin @@ -74,11 +74,11 @@ The project itself uses ESLint to helps linting rule algorithms. ### In the SonarQube plugin -Now that the rule has been implemented in the ecoCode referential and its implementation written in the ESLint plugin, +Now that the rule has been implemented in the Creedengo referential and its implementation written in the ESLint plugin, all that remains is to reference it in the SonarQube plugin. Here are the simple steps: -1. Create a Java class in `src/main/java/io/ecocode/javascript/checks/` with the declaration of the SonarQube key and - the ESLint key (check other classes to have an example) +1. Create a Java class in `src/main/java/fr/greencodeinitiative/creedengo/javascript/checks/` with + the declaration of the SonarQube key and the ESLint key (check other classes to have an example) 2. Reference created in method `getAllChecks()` of Java class `CheckList` (please use alphabetical order) 3. Add the SonarQube key of the rule in the appropriate profile Json file. diff --git a/README.md b/README.md index f6bfc5b..06337da 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,17 @@ -![Logo](https://github.com/green-code-initiative/ecoCode/blob/main/docs/resources/logo-large.png?raw=true) +# Creedengo-JS -Websites are becoming increasingly heavy and complex over the years. They represent an important part -of the digital environmental footprint. The objective of this project is to detect smells in a website source code -that can have a negative ecological impact: overconsumption of energy, "fatware", shortening of the life span of -devices, etc. This project is part of [ecoCode](https://github.com/green-code-initiative/ecoCode). +_creedengo_ is a collective project aiming to reduce environmental footprint of software at the code level. The goal of the project is to provide a list of static code analyzers to highlight code structures that may have a negative ecological impact: energy and resources over-consumption, "fatware", shortening terminals' lifespan, etc. -Rules in this repository are mainly based from book -[115 Web Ecodesign Best Practices](https://github.com/cnumr/best-practices). -This reference is maintained by [CNumR](https://collectif.greenit.fr/), a french collective that works -for a responsible design of digital services. You can find all applicable rules in the [RULES.md file](RULES.md). +Websites are becoming increasingly heavy and complex over the years. They represent an important part +of the digital environmental footprint. The JavaScript/TypeScript part of the project focuses on providing rules and guidelines to optimize web applications and server-side code written in JavaScript and TypeScript. [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) -![Build](https://github.com/green-code-initiative/ecoCode-javascript/actions/workflows/build.yml/badge.svg) +![Build](https://github.com/green-code-initiative/creedengo-javascript/actions/workflows/ci.yml/badge.svg) [![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) -🌿 SonarQube plugin ---------------------------------- +## 🌿 SonarQube plugin -_ecoCode_ JavaScript is an "eco-responsibility" static code analyzer for projects based on the JavaScript ecosystem. It +_Creedengo_ JavaScript is an "eco-responsibility" static code analyzer for projects based on the JavaScript ecosystem. It can handle JavaScript, TypeScript and all frameworks that use them. Its main purpose is to work with website source code, but it can also analyze back-end code. @@ -29,38 +23,34 @@ This project proposes rules for the following technologies: - React (JSX) - React Native / Expo -🔧 ESLint plugin ----------------- +## 🔧 ESLint plugin This project uses an internal ESLint plugin to analyze your source code. If you are not using SonarQube, we have a solution for you: the linter is working nicely on its own! \ Follow instructions in the [dedicated README file](eslint-plugin/README.md) to use it as a standalone plugin. -🛒 Distribution ---------------- +## 🛒 Distribution -[![sonar-plugin version](https://img.shields.io/github/v/release/green-code-initiative/ecoCode-javascript?label=SonarQube%20plugin)](https://github.com/green-code-initiative/ecoCode-javascript/releases/latest) -[![eslint-plugin version](https://img.shields.io/npm/v/@ecocode/eslint-plugin?label=ESLint%20plugin)](https://npmjs.com/package/@ecocode/eslint-plugin) +[![sonar-plugin version](https://img.shields.io/github/v/release/green-code-initiative/creedengo-javascript?label=SonarQube%20plugin)](https://github.com/green-code-initiative/creedengo-javascript/releases/latest) +[![eslint-plugin version](https://img.shields.io/npm/v/@creedengo/eslint-plugin?label=ESLint%20plugin)](https://npmjs.com/package/@creedengo/eslint-plugin) **The plugin is available from the official SonarQube marketplace! Check the [version matrix here](https://docs.sonarsource.com/sonarqube/latest/instance-administration/plugin-version-matrix/).** Ready to use binaries for SonarQube are also -available [from GitHub](https://github.com/green-code-initiative/ecoCode-javascript/releases). \ +available [from GitHub](https://github.com/green-code-initiative/creedengo-javascript/releases). \ Make sure to place the binary inside `extensions/plugins/` folder of your SonarQube instance. -The standalone version of the ESLint plugin is available from [npmjs](https://npmjs.com/package/@ecocode/eslint-plugin). +The standalone version of the ESLint plugin is available from [npmjs](https://npmjs.com/package/@creedengo/eslint-plugin). -🧩 Compatibility ----------------- +## 🧩 Compatibility | Plugins Version | SonarQube version | ESLint version | -|-----------------|-------------------|----------------| +| --------------- | ----------------- | -------------- | | 1.4.+, 1.5.+ | 9.9.+ LTA to 10.7 | 7+ | -🤝 Contribution ---------------- +## 🤝 Contribution You have an idea or you want to help us improving this project? \ We are open to your suggestions and contributions! Open an issue or PR 🚀 @@ -68,7 +58,7 @@ We are open to your suggestions and contributions! Open an issue or PR 🚀 Check out the [CONTRIBUTING.md](CONTRIBUTING.md) file and follow the various guides to start contributing. -Thank you to all the people who already contributed to ecoCode-javascript! +Thank you to all the people who already contributed to creedengo-javascript! - Elise Dubillot - Laetitia Bézie diff --git a/RULES.md b/RULES.md index 13bf375..d48fa61 100644 --- a/RULES.md +++ b/RULES.md @@ -1 +1 @@ -Please read [RULES.md](https://github.com/green-code-initiative/ecoCode/blob/main/RULES.md) in `ecoCode` repository. +Please read [RULES.md](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/RULES.md) in `creedengo-rules-specifications` repository. diff --git a/docker-compose.yml b/docker-compose.yml index 7bc4e26..09053ed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,10 @@ --- -name: sonarqube_ecocode_javascript +name: sonarqube_creedengo_javascript services: sonar: image: sonarqube:10.7-community - container_name: sonar_ecocode_javascript + container_name: sonar_creedengo_javascript ports: - "9000:9000" networks: @@ -19,8 +19,8 @@ services: SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: "true" volumes: - type: bind - source: ./sonar-plugin/target/ecocode-javascript-plugin-1.5.1-SNAPSHOT.jar - target: /opt/sonarqube/extensions/plugins/ecocode-javascript-plugin-1.5.1-SNAPSHOT.jar + source: ./sonar-plugin/target/creedengo-javascript-plugin-1.5.1-SNAPSHOT.jar + target: /opt/sonarqube/extensions/plugins/creedengo-javascript-plugin-1.5.1-SNAPSHOT.jar - "extensions:/opt/sonarqube/extensions" - "logs:/opt/sonarqube/logs" - "data:/opt/sonarqube/data" @@ -32,7 +32,7 @@ services: db: image: postgres:16-alpine - container_name: postgresql_ecocode_javascript + container_name: postgresql_creedengo_javascript networks: - sonarnet volumes: diff --git a/eslint-plugin/.eslintrc.js b/eslint-plugin/.eslintrc.js index 8af5fde..2f053b3 100644 --- a/eslint-plugin/.eslintrc.js +++ b/eslint-plugin/.eslintrc.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/README.md b/eslint-plugin/README.md index de9b872..969caa2 100644 --- a/eslint-plugin/README.md +++ b/eslint-plugin/README.md @@ -1,14 +1,12 @@ -![Logo](https://github.com/green-code-initiative/ecoCode/blob/main/docs/resources/logo-large.png?raw=true) -====================================== +# Creedengo-JS -An ESLint plugin which provides JavaScript and TypeScript rules of the ecoCode project. +An ESLint plugin which provides JavaScript and TypeScript rules of the Creedengo project. -👉 See [ecoCode-javascript README](../README.md) to have more information. +👉 See [creedengo-javascript README](../README.md) to have more information. > ⚠️ This plugin is in a very early stage and need improvements. Any contribution will be appreciated. -🚀 Getting started ------------------- +## 🚀 Getting started ### Installation @@ -16,9 +14,9 @@ You'll need to install [ESLint](https://eslint.org/) (v7 or newer) and this plug ```sh # yarn -yarn add -D eslint @ecocode/eslint-plugin +yarn add -D eslint @creedengo/eslint-plugin # npm -npm install -D eslint @ecocode/eslint-plugin +npm install -D eslint @creedengo/eslint-plugin ``` > You are using TypeScript? You will also need to install [typescript-eslint](https://typescript-eslint.io/) to enable @@ -31,36 +29,35 @@ The plugin is also available from GitHub npm registry under "green-code-initiati ```sh # yarn -yarn add -D eslint @green-code-initiative/ecocode-eslint-plugin +yarn add -D eslint @green-code-initiative/creedengo-eslint-plugin # npm -npm install -D eslint @green-code-initiative/ecocode-eslint-plugin +npm install -D eslint @green-code-initiative/creedengo-eslint-plugin ``` ### Enable whole plugin -Add `@ecocode` recommended configuration to `extends` section of your `.eslintrc`: +Add `@creedengo` recommended configuration to `extends` section of your `.eslintrc`: ```jsonc { - "extends": ["plugin:@ecocode/recommended"] + "extends": ["plugin:@creedengo/recommended"], } ``` ### Enable only some rules -Add `@ecocode` to the `plugins` section of your `.eslintrc`, followed by rules configuration: +Add `@creedengo` to the `plugins` section of your `.eslintrc`, followed by rules configuration: ```jsonc { - "plugins": ["@ecocode"], + "plugins": ["@creedengo"], "rules": { - "@ecocode/no-multiple-access-dom-element": "error" - } + "@creedengo/no-multiple-access-dom-element": "error", + }, } ``` -🔨 Rules --------- +## 🔨 Rules @@ -84,8 +81,6 @@ Add `@ecocode` to the `plugins` section of your `.eslintrc`, followed by rules c +## 🛒 Distribution -🛒 Distribution ---------------- - -You can follow changelog on [GitHub Releases page](https://github.com/green-code-initiative/ecoCode-linter/releases). +You can follow changelog on [GitHub Releases page](https://github.com/green-code-initiative/creedengo-javascript/releases). diff --git a/eslint-plugin/docs/license-header.txt b/eslint-plugin/docs/license-header.txt index 213fdaa..b1fc32f 100644 --- a/eslint-plugin/docs/license-header.txt +++ b/eslint-plugin/docs/license-header.txt @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/docs/rules/avoid-brightness-override.md b/eslint-plugin/docs/rules/avoid-brightness-override.md index 34a3e3f..83bc6fe 100644 --- a/eslint-plugin/docs/rules/avoid-brightness-override.md +++ b/eslint-plugin/docs/rules/avoid-brightness-override.md @@ -1,4 +1,4 @@ -# Should avoid to override brightness (`@ecocode/avoid-brightness-override`) +# Should avoid to override brightness (`@creedengo/avoid-brightness-override`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/avoid-css-animations.md b/eslint-plugin/docs/rules/avoid-css-animations.md index 2a77558..5b4afa5 100644 --- a/eslint-plugin/docs/rules/avoid-css-animations.md +++ b/eslint-plugin/docs/rules/avoid-css-animations.md @@ -1,4 +1,4 @@ -# Avoid usage of CSS animations (`@ecocode/avoid-css-animations`) +# Avoid usage of CSS animations (`@creedengo/avoid-css-animations`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/avoid-high-accuracy-geolocation.md b/eslint-plugin/docs/rules/avoid-high-accuracy-geolocation.md index 49e4072..28c5a10 100644 --- a/eslint-plugin/docs/rules/avoid-high-accuracy-geolocation.md +++ b/eslint-plugin/docs/rules/avoid-high-accuracy-geolocation.md @@ -1,4 +1,4 @@ -# Avoid using high accuracy geolocation in web applications (`@ecocode/avoid-high-accuracy-geolocation`) +# Avoid using high accuracy geolocation in web applications (`@creedengo/avoid-high-accuracy-geolocation`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/limit-db-query-results.md b/eslint-plugin/docs/rules/limit-db-query-results.md index e996235..534835a 100644 --- a/eslint-plugin/docs/rules/limit-db-query-results.md +++ b/eslint-plugin/docs/rules/limit-db-query-results.md @@ -1,4 +1,4 @@ -# Should limit the number of returns for a SQL query (`@ecocode/limit-db-query-results`) +# Should limit the number of returns for a SQL query (`@creedengo/limit-db-query-results`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/no-empty-image-src-attribute.md b/eslint-plugin/docs/rules/no-empty-image-src-attribute.md index 8051a81..4723ac3 100644 --- a/eslint-plugin/docs/rules/no-empty-image-src-attribute.md +++ b/eslint-plugin/docs/rules/no-empty-image-src-attribute.md @@ -1,4 +1,4 @@ -# Disallow usage of image with empty source attribute (`@ecocode/no-empty-image-src-attribute`) +# Disallow usage of image with empty source attribute (`@creedengo/no-empty-image-src-attribute`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/no-import-all-from-library.md b/eslint-plugin/docs/rules/no-import-all-from-library.md index 9b3b541..96b354b 100644 --- a/eslint-plugin/docs/rules/no-import-all-from-library.md +++ b/eslint-plugin/docs/rules/no-import-all-from-library.md @@ -1,4 +1,4 @@ -# Should not import all from library (`@ecocode/no-import-all-from-library`) +# Should not import all from library (`@creedengo/no-import-all-from-library`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/no-multiple-access-dom-element.md b/eslint-plugin/docs/rules/no-multiple-access-dom-element.md index b88d139..7bf450c 100644 --- a/eslint-plugin/docs/rules/no-multiple-access-dom-element.md +++ b/eslint-plugin/docs/rules/no-multiple-access-dom-element.md @@ -1,4 +1,4 @@ -# Disallow multiple access of same DOM element (`@ecocode/no-multiple-access-dom-element`) +# Disallow multiple access of same DOM element (`@creedengo/no-multiple-access-dom-element`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/no-multiple-style-changes.md b/eslint-plugin/docs/rules/no-multiple-style-changes.md index 1742cdd..59d13a9 100644 --- a/eslint-plugin/docs/rules/no-multiple-style-changes.md +++ b/eslint-plugin/docs/rules/no-multiple-style-changes.md @@ -1,4 +1,4 @@ -# Disallow multiple style changes at once (`@ecocode/no-multiple-style-changes`) +# Disallow multiple style changes at once (`@creedengo/no-multiple-style-changes`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/no-torch.md b/eslint-plugin/docs/rules/no-torch.md index ca068a4..9e0c0f6 100644 --- a/eslint-plugin/docs/rules/no-torch.md +++ b/eslint-plugin/docs/rules/no-torch.md @@ -1,4 +1,4 @@ -# Should not programmatically enable torch mode (`@ecocode/no-torch`) +# Should not programmatically enable torch mode (`@creedengo/no-torch`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/prefer-collections-with-pagination.md b/eslint-plugin/docs/rules/prefer-collections-with-pagination.md index 2a457d8..ab79078 100644 --- a/eslint-plugin/docs/rules/prefer-collections-with-pagination.md +++ b/eslint-plugin/docs/rules/prefer-collections-with-pagination.md @@ -1,4 +1,4 @@ -# Prefer API collections with pagination (`@ecocode/prefer-collections-with-pagination`) +# Prefer API collections with pagination (`@creedengo/prefer-collections-with-pagination`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/prefer-shorthand-css-notations.md b/eslint-plugin/docs/rules/prefer-shorthand-css-notations.md index e8f66e2..a8c3cd9 100644 --- a/eslint-plugin/docs/rules/prefer-shorthand-css-notations.md +++ b/eslint-plugin/docs/rules/prefer-shorthand-css-notations.md @@ -1,4 +1,4 @@ -# Encourage usage of shorthand CSS notations (`@ecocode/prefer-shorthand-css-notations`) +# Encourage usage of shorthand CSS notations (`@creedengo/prefer-shorthand-css-notations`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/docs/rules/provide-print-css.md b/eslint-plugin/docs/rules/provide-print-css.md index 42f13b3..d90225f 100644 --- a/eslint-plugin/docs/rules/provide-print-css.md +++ b/eslint-plugin/docs/rules/provide-print-css.md @@ -1,4 +1,4 @@ -# Enforce providing a print stylesheet (`@ecocode/provide-print-css`) +# Enforce providing a print stylesheet (`@creedengo/provide-print-css`) ⚠️ This rule _warns_ in the ✅ `recommended` config. diff --git a/eslint-plugin/lib/rule-list.js b/eslint-plugin/lib/rule-list.js index 9f8cce8..b0cac44 100644 --- a/eslint-plugin/lib/rule-list.js +++ b/eslint-plugin/lib/rule-list.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/avoid-brightness-override.js b/eslint-plugin/lib/rules/avoid-brightness-override.js index e2c881d..7f84517 100644 --- a/eslint-plugin/lib/rules/avoid-brightness-override.js +++ b/eslint-plugin/lib/rules/avoid-brightness-override.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/avoid-css-animations.js b/eslint-plugin/lib/rules/avoid-css-animations.js index 7515895..05cb30d 100644 --- a/eslint-plugin/lib/rules/avoid-css-animations.js +++ b/eslint-plugin/lib/rules/avoid-css-animations.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/avoid-high-accuracy-geolocation.js b/eslint-plugin/lib/rules/avoid-high-accuracy-geolocation.js index 4cd33f4..a6b1123 100644 --- a/eslint-plugin/lib/rules/avoid-high-accuracy-geolocation.js +++ b/eslint-plugin/lib/rules/avoid-high-accuracy-geolocation.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/limit-db-query-results.js b/eslint-plugin/lib/rules/limit-db-query-results.js index c9b09c8..30f96ce 100644 --- a/eslint-plugin/lib/rules/limit-db-query-results.js +++ b/eslint-plugin/lib/rules/limit-db-query-results.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/no-empty-image-src-attribute.js b/eslint-plugin/lib/rules/no-empty-image-src-attribute.js index 0b85b62..ed0d148 100644 --- a/eslint-plugin/lib/rules/no-empty-image-src-attribute.js +++ b/eslint-plugin/lib/rules/no-empty-image-src-attribute.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/no-import-all-from-library.js b/eslint-plugin/lib/rules/no-import-all-from-library.js index 3d6a37b..35af099 100644 --- a/eslint-plugin/lib/rules/no-import-all-from-library.js +++ b/eslint-plugin/lib/rules/no-import-all-from-library.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/no-multiple-access-dom-element.js b/eslint-plugin/lib/rules/no-multiple-access-dom-element.js index 96e3b59..92ee04c 100644 --- a/eslint-plugin/lib/rules/no-multiple-access-dom-element.js +++ b/eslint-plugin/lib/rules/no-multiple-access-dom-element.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/no-multiple-style-changes.js b/eslint-plugin/lib/rules/no-multiple-style-changes.js index 08f3fb6..1977dbe 100644 --- a/eslint-plugin/lib/rules/no-multiple-style-changes.js +++ b/eslint-plugin/lib/rules/no-multiple-style-changes.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/no-torch.js b/eslint-plugin/lib/rules/no-torch.js index 27d31c5..65d924e 100644 --- a/eslint-plugin/lib/rules/no-torch.js +++ b/eslint-plugin/lib/rules/no-torch.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/prefer-collections-with-pagination.js b/eslint-plugin/lib/rules/prefer-collections-with-pagination.js index d11c0e6..aa0b398 100644 --- a/eslint-plugin/lib/rules/prefer-collections-with-pagination.js +++ b/eslint-plugin/lib/rules/prefer-collections-with-pagination.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/prefer-shorthand-css-notations.js b/eslint-plugin/lib/rules/prefer-shorthand-css-notations.js index b9ff1fb..a1fc288 100644 --- a/eslint-plugin/lib/rules/prefer-shorthand-css-notations.js +++ b/eslint-plugin/lib/rules/prefer-shorthand-css-notations.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/rules/provide-print-css.js b/eslint-plugin/lib/rules/provide-print-css.js index 0b1a902..53dc229 100644 --- a/eslint-plugin/lib/rules/provide-print-css.js +++ b/eslint-plugin/lib/rules/provide-print-css.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/lib/sonar.js b/eslint-plugin/lib/sonar.js index fc236c2..54e6c87 100644 --- a/eslint-plugin/lib/sonar.js +++ b/eslint-plugin/lib/sonar.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ */ /** - * @fileoverview JavaScript linter of ecoCode project (Sonar mode) + * @fileoverview JavaScript linter of Creedengo project (Sonar mode) * @author Green Code Initiative */ "use strict"; @@ -26,7 +26,7 @@ const rules = require("./rule-list"); module.exports = { rules: rules.map((rule) => ({ - ruleId: `@ecocode/${rule.ruleName}`, + ruleId: `@creedengo/${rule.ruleName}`, ruleModule: rule.ruleModule, ruleConfig: [], })), diff --git a/eslint-plugin/lib/standalone.js b/eslint-plugin/lib/standalone.js index 8d23003..bedfa78 100644 --- a/eslint-plugin/lib/standalone.js +++ b/eslint-plugin/lib/standalone.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ */ /** - * @fileoverview JavaScript linter of ecoCode project (standalone mode) + * @fileoverview JavaScript linter of Creedengo project (standalone mode) * @author Green Code Initiative */ "use strict"; @@ -31,12 +31,12 @@ const ruleModules = rules.reduce((map, rule) => { const ruleConfigs = rules.reduce((map, rule) => { const recommended = rule.ruleModule.meta.docs.recommended; - map[`@ecocode/${rule.ruleName}`] = + map[`@creedengo/${rule.ruleName}`] = recommended === false ? "off" : recommended; return map; }, {}); module.exports = { rules: ruleModules, - configs: { recommended: { plugins: ["@ecocode"], rules: ruleConfigs } }, + configs: { recommended: { plugins: ["@creedengo"], rules: ruleConfigs } }, }; diff --git a/eslint-plugin/package.json b/eslint-plugin/package.json index d149025..f6dcbd6 100644 --- a/eslint-plugin/package.json +++ b/eslint-plugin/package.json @@ -1,17 +1,17 @@ { - "name": "@ecocode/eslint-plugin", + "name": "@creedengo/eslint-plugin", "version": "1.5.0", - "description": "JavaScript linter of ecoCode project", + "description": "JavaScript linter of creedengo project", "keywords": [ "eslint", "eslintplugin", "eslint-plugin", - "ecocode", + "creedengo", "greenit" ], "repository": { "type": "git", - "url": "git+https://github.com/green-code-initiative/ecoCode-javascript.git", + "url": "git+https://github.com/green-code-initiative/creedengo-javascript.git", "directory": "eslint-plugin" }, "license": "GPL-3.0", @@ -26,7 +26,7 @@ "lint:eslint-docs": "eslint-doc-generator --check", "lint:js": "eslint .", "lint:fix": "eslint . --fix", - "pack:sonar": "npm pkg set main=\"./lib/sonar.js\" && mkdirp dist/pack && yarn pack -o dist/pack/ecocode-eslint-plugin.tgz && npm pkg set main=\"./lib/standalone.js\"", + "pack:sonar": "npm pkg set main=\"./lib/sonar.js\" && mkdirp dist/pack && yarn pack -o dist/pack/creedengo-eslint-plugin.tgz && npm pkg set main=\"./lib/standalone.js\"", "test": "mocha tests --recursive", "test:cov": "nyc --reporter=lcov --reporter=text mocha tests --recursive", "update:eslint-docs": "eslint-doc-generator" diff --git a/eslint-plugin/tests/lib/rule-list.test.js b/eslint-plugin/tests/lib/rule-list.test.js index 78aa817..a1a2280 100644 --- a/eslint-plugin/tests/lib/rule-list.test.js +++ b/eslint-plugin/tests/lib/rule-list.test.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/avoid-brightness-override.js b/eslint-plugin/tests/lib/rules/avoid-brightness-override.js index eb6cfa5..b33a496 100644 --- a/eslint-plugin/tests/lib/rules/avoid-brightness-override.js +++ b/eslint-plugin/tests/lib/rules/avoid-brightness-override.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/avoid-css-animations.js b/eslint-plugin/tests/lib/rules/avoid-css-animations.js index f44b8f7..0f19962 100644 --- a/eslint-plugin/tests/lib/rules/avoid-css-animations.js +++ b/eslint-plugin/tests/lib/rules/avoid-css-animations.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/avoid-high-accuracy-geolocation.js b/eslint-plugin/tests/lib/rules/avoid-high-accuracy-geolocation.js index a08b154..1c32067 100644 --- a/eslint-plugin/tests/lib/rules/avoid-high-accuracy-geolocation.js +++ b/eslint-plugin/tests/lib/rules/avoid-high-accuracy-geolocation.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/limit-db-query-results.js b/eslint-plugin/tests/lib/rules/limit-db-query-results.js index 353a65e..cff326f 100644 --- a/eslint-plugin/tests/lib/rules/limit-db-query-results.js +++ b/eslint-plugin/tests/lib/rules/limit-db-query-results.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/no-empty-image-src-attribute.js b/eslint-plugin/tests/lib/rules/no-empty-image-src-attribute.js index a0d77ac..1c51f5c 100644 --- a/eslint-plugin/tests/lib/rules/no-empty-image-src-attribute.js +++ b/eslint-plugin/tests/lib/rules/no-empty-image-src-attribute.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/no-import-all-from-library.js b/eslint-plugin/tests/lib/rules/no-import-all-from-library.js index a1a8772..069d20f 100644 --- a/eslint-plugin/tests/lib/rules/no-import-all-from-library.js +++ b/eslint-plugin/tests/lib/rules/no-import-all-from-library.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/no-multiple-access-dom-element.js b/eslint-plugin/tests/lib/rules/no-multiple-access-dom-element.js index 25fde29..bf960e1 100644 --- a/eslint-plugin/tests/lib/rules/no-multiple-access-dom-element.js +++ b/eslint-plugin/tests/lib/rules/no-multiple-access-dom-element.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/no-multiple-style-changes.js b/eslint-plugin/tests/lib/rules/no-multiple-style-changes.js index 085828e..90e9e4d 100644 --- a/eslint-plugin/tests/lib/rules/no-multiple-style-changes.js +++ b/eslint-plugin/tests/lib/rules/no-multiple-style-changes.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/no-torch.js b/eslint-plugin/tests/lib/rules/no-torch.js index 0e8ddd7..7d0fa8d 100644 --- a/eslint-plugin/tests/lib/rules/no-torch.js +++ b/eslint-plugin/tests/lib/rules/no-torch.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/prefer-collections-with-pagination.js b/eslint-plugin/tests/lib/rules/prefer-collections-with-pagination.js index ca247e3..6747c9c 100644 --- a/eslint-plugin/tests/lib/rules/prefer-collections-with-pagination.js +++ b/eslint-plugin/tests/lib/rules/prefer-collections-with-pagination.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/prefer-shorthand-css-notations.js b/eslint-plugin/tests/lib/rules/prefer-shorthand-css-notations.js index 2525176..d792380 100644 --- a/eslint-plugin/tests/lib/rules/prefer-shorthand-css-notations.js +++ b/eslint-plugin/tests/lib/rules/prefer-shorthand-css-notations.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/rules/provide-print-css.js b/eslint-plugin/tests/lib/rules/provide-print-css.js index 620c45d..6a18874 100644 --- a/eslint-plugin/tests/lib/rules/provide-print-css.js +++ b/eslint-plugin/tests/lib/rules/provide-print-css.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/eslint-plugin/tests/lib/sonar.test.js b/eslint-plugin/tests/lib/sonar.test.js index d0843e5..f31b561 100644 --- a/eslint-plugin/tests/lib/sonar.test.js +++ b/eslint-plugin/tests/lib/sonar.test.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ describe("sonar.js", () => { it("should export all rules with a specific rule id pattern", () => { const { rules } = require("../../lib/sonar"); assert.notEqual(rules.length, 0); - assert.match(rules[0].ruleId, /@ecocode\/.*/); + assert.match(rules[0].ruleId, /@creedengo\/.*/); assert.equal(rules[0].ruleConfig.length, 0); }); }); diff --git a/eslint-plugin/tests/lib/standalone.test.js b/eslint-plugin/tests/lib/standalone.test.js index 88658e2..9b3581d 100644 --- a/eslint-plugin/tests/lib/standalone.test.js +++ b/eslint-plugin/tests/lib/standalone.test.js @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ describe("standalone.js", () => { const recommended = configs.recommended; assert.notEqual(recommended, null); assert.equal(recommended.plugins.length, 1); - assert.equal(recommended.plugins[0], "@ecocode"); + assert.equal(recommended.plugins[0], "@creedengo"); assert.equal(recommended.rules.length, rules.length); }); }); diff --git a/eslint-plugin/yarn.lock b/eslint-plugin/yarn.lock index 3c9c567..13758d4 100644 --- a/eslint-plugin/yarn.lock +++ b/eslint-plugin/yarn.lock @@ -247,9 +247,9 @@ __metadata: languageName: node linkType: hard -"@ecocode/eslint-plugin@workspace:.": +"@creedengo/eslint-plugin@workspace:.": version: 0.0.0-use.local - resolution: "@ecocode/eslint-plugin@workspace:." + resolution: "@creedengo/eslint-plugin@workspace:." dependencies: "@typescript-eslint/eslint-plugin": "npm:^5.62.0" "@typescript-eslint/parser": "npm:^5.62.0" diff --git a/sonar-plugin/pom.xml b/sonar-plugin/pom.xml index 9dc5a78..198f6b4 100644 --- a/sonar-plugin/pom.xml +++ b/sonar-plugin/pom.xml @@ -3,32 +3,32 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.ecocode - ecocode-javascript-plugin + org.green-code-initiative + creedengo-javascript-plugin 1.5.1-SNAPSHOT sonar-plugin - ecoCode JavaScript plugin + Creedengo JavaScript plugin Provides rules to reduce the environmental footprint of your JavaScript programs 2023 - https://github.com/green-code-initiative/ecoCode-javascript + https://github.com/green-code-initiative/creedengo-javascript green-code-initiative https://github.com/green-code-initiative - scm:git:https://github.com/green-code-initiative/ecocode-javascript - scm:git:https://github.com/green-code-initiative/ecocode-javascript - https://github.com/green-code-initiative/ecocode-javascript + scm:git:https://github.com/green-code-initiative/creedengo-javascript + scm:git:https://github.com/green-code-initiative/creedengo-javascript + https://github.com/green-code-initiative/creedengo-javascript HEAD GitHub - https://github.com/green-code-initiative/ecocode-javascript/issues + https://github.com/green-code-initiative/creedengo-javascript/issues @@ -49,7 +49,7 @@ ${encoding} ${encoding} - 1.6.4 + 2.1.0 9.14.0.375 9.13.0.20537 1.23.0.740 @@ -68,9 +68,9 @@ - io.ecocode - ecocode-rules-specifications - ${version.ecocode-rules-specifications} + org.green-code-initiative + creedengo-rules-specifications + ${version.creedengo-rules-specifications} javascript @@ -135,9 +135,9 @@ ${version.sonar-packaging} true - ecocodejavascript + creedengojavascript ${project.name} - io.ecocode.javascript.JavaScriptPlugin + org.greencodeinitiative.creedengo.javascript.JavaScriptPlugin false ${version.sonarqube} true @@ -172,7 +172,7 @@ - org.*:* + org.sonarsource.*:* META-INF/** javax/annotation/** @@ -264,7 +264,7 @@ Green Code Initiative - https://www.ecocode.io + https://green-code-initiative.org diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/CheckList.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/CheckList.java similarity index 87% rename from sonar-plugin/src/main/java/io/ecocode/javascript/CheckList.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/CheckList.java index c6676af..a29ca73 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/CheckList.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/CheckList.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; -import io.ecocode.javascript.checks.*; +import org.greencodeinitiative.creedengo.javascript.checks.*; import org.sonar.plugins.javascript.api.JavaScriptCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; import org.sonar.plugins.javascript.api.TypeScriptRule; diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/ESLintRulesBundle.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/ESLintRulesBundle.java similarity index 73% rename from sonar-plugin/src/main/java/io/ecocode/javascript/ESLintRulesBundle.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/ESLintRulesBundle.java index 3d25f3b..82525a5 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/ESLintRulesBundle.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/ESLintRulesBundle.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.sonar.plugins.javascript.api.RulesBundle; @@ -23,7 +23,7 @@ public class ESLintRulesBundle implements RulesBundle { @Override public String bundlePath() { - return "/ecocode-eslint-plugin.tgz"; + return "/creedengo-eslint-plugin.tgz"; } } diff --git a/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/EcoCodeRule.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/EcoCodeRule.java new file mode 100644 index 0000000..767380f --- /dev/null +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/EcoCodeRule.java @@ -0,0 +1,50 @@ +/* + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.greencodeinitiative.creedengo.javascript; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.List; + +import org.sonar.api.server.rule.RulesDefinition.NewRepository; +import org.sonar.check.Rule; + +/** + * Used to handle old ecoCode rule keys. + */ +public class EcoCodeRule { + + @Retention(RetentionPolicy.RUNTIME) + @Target({ ElementType.TYPE }) + public @interface Key { + String value(); + } + + public static void addOnRepository(NewRepository repository, String oldRepositoryKey, List> checks) { + checks.forEach(check -> { + if (check.isAnnotationPresent(Key.class)) { + Rule rule = check.getAnnotation(Rule.class); + Key ecoCodeRuleKey = check.getAnnotation(Key.class); + repository.rule(rule.key()).addDeprecatedRuleKey(oldRepositoryKey, ecoCodeRuleKey.value()); + } + }); + } + +} diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptPlugin.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptPlugin.java similarity index 78% rename from sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptPlugin.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptPlugin.java index ca493f9..01f9fb9 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptPlugin.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptPlugin.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,13 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.sonar.api.Plugin; public class JavaScriptPlugin implements Plugin { - public static final String NAME = "ecoCode"; + public static final String NAME = "Creedengo"; @Override public void define(Context context) { diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptRuleRepository.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRuleRepository.java similarity index 78% rename from sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptRuleRepository.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRuleRepository.java index c4ca425..ec57ea9 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptRuleRepository.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRuleRepository.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,19 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; - -import org.sonar.plugins.javascript.api.CustomRuleRepository; -import org.sonar.plugins.javascript.api.JavaScriptCheck; +package org.greencodeinitiative.creedengo.javascript; import java.util.EnumSet; import java.util.List; import java.util.Set; +import org.sonar.plugins.javascript.api.CustomRuleRepository; +import org.sonar.plugins.javascript.api.JavaScriptCheck; + @SuppressWarnings("deprecation") public class JavaScriptRuleRepository implements CustomRuleRepository { - public static final String KEY = "ecocode-javascript"; + public static final String KEY = "creedengo-javascript"; + + public static final String OLD_KEY = "ecocode-javascript"; public static final String LANGUAGE = "js"; diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptRulesDefinition.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRulesDefinition.java similarity index 63% rename from sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptRulesDefinition.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRulesDefinition.java index 679fdec..71a7c13 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/JavaScriptRulesDefinition.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRulesDefinition.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,19 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; + +import java.util.Collections; +import java.util.List; import org.sonar.api.SonarRuntime; import org.sonar.api.server.rule.RulesDefinition; import org.sonarsource.analyzer.commons.RuleMetadataLoader; -import java.util.Collections; - public class JavaScriptRulesDefinition implements RulesDefinition { - private static final String METADATA_LOCATION = "io/ecocode/rules/javascript"; + private static final String METADATA_LOCATION = "org/green-code-initiative/rules/javascript"; - private static final String PROFILE_PATH = "io/ecocode/profiles/ecocode_javascript_profile.json"; + private static final String PROFILE_PATH = "org/greencodeinitiative/creedengo/profiles/javascript_profile.json"; private final SonarRuntime sonarRuntime; @@ -41,16 +42,12 @@ public void define(Context context) { .createRepository(JavaScriptRuleRepository.KEY, JavaScriptRuleRepository.LANGUAGE) .setName(JavaScriptPlugin.NAME); - RuleMetadataLoader ruleMetadataLoader = new RuleMetadataLoader( - METADATA_LOCATION, - PROFILE_PATH, - sonarRuntime - ); + RuleMetadataLoader ruleMetadataLoader = new RuleMetadataLoader(METADATA_LOCATION, PROFILE_PATH, sonarRuntime); + + List> checks = Collections.unmodifiableList(CheckList.getJavaScriptChecks()); - ruleMetadataLoader.addRulesByAnnotatedClass( - repository, - Collections.unmodifiableList(CheckList.getJavaScriptChecks()) - ); + ruleMetadataLoader.addRulesByAnnotatedClass(repository, checks); + EcoCodeRule.addOnRepository(repository, JavaScriptRuleRepository.OLD_KEY, checks); repository.done(); } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/TypeScriptRuleRepository.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRuleRepository.java similarity index 78% rename from sonar-plugin/src/main/java/io/ecocode/javascript/TypeScriptRuleRepository.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRuleRepository.java index 4d408a9..3757f40 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/TypeScriptRuleRepository.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRuleRepository.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,19 +15,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; - -import org.sonar.plugins.javascript.api.CustomRuleRepository; -import org.sonar.plugins.javascript.api.JavaScriptCheck; +package org.greencodeinitiative.creedengo.javascript; import java.util.EnumSet; import java.util.List; import java.util.Set; +import org.sonar.plugins.javascript.api.CustomRuleRepository; +import org.sonar.plugins.javascript.api.JavaScriptCheck; + @SuppressWarnings("deprecation") public class TypeScriptRuleRepository implements CustomRuleRepository { - public static final String KEY = "ecocode-typescript"; + public static final String KEY = "creedengo-typescript"; + + public static final String OLD_KEY = "ecocode-typescript"; public static final String LANGUAGE = "ts"; diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/TypeScriptRulesDefinition.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRulesDefinition.java similarity index 63% rename from sonar-plugin/src/main/java/io/ecocode/javascript/TypeScriptRulesDefinition.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRulesDefinition.java index 166938f..74b4192 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/TypeScriptRulesDefinition.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRulesDefinition.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,19 +15,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; + +import java.util.Collections; +import java.util.List; import org.sonar.api.SonarRuntime; import org.sonar.api.server.rule.RulesDefinition; import org.sonarsource.analyzer.commons.RuleMetadataLoader; -import java.util.Collections; - public class TypeScriptRulesDefinition implements RulesDefinition { - private static final String METADATA_LOCATION = "io/ecocode/rules/javascript"; + private static final String METADATA_LOCATION = "org/green-code-initiative/rules/javascript"; - private static final String PROFILE_PATH = "io/ecocode/profiles/ecocode_typescript_profile.json"; + private static final String PROFILE_PATH = "org/greencodeinitiative/creedengo/profiles/typescript_profile.json"; private final SonarRuntime sonarRuntime; @@ -41,16 +42,12 @@ public void define(Context context) { .createRepository(TypeScriptRuleRepository.KEY, TypeScriptRuleRepository.LANGUAGE) .setName(JavaScriptPlugin.NAME); - RuleMetadataLoader ruleMetadataLoader = new RuleMetadataLoader( - METADATA_LOCATION, - PROFILE_PATH, - sonarRuntime - ); + RuleMetadataLoader ruleMetadataLoader = new RuleMetadataLoader(METADATA_LOCATION, PROFILE_PATH, sonarRuntime); + + List> checks = Collections.unmodifiableList(CheckList.getTypeScriptChecks()); - ruleMetadataLoader.addRulesByAnnotatedClass( - repository, - Collections.unmodifiableList(CheckList.getTypeScriptChecks()) - ); + ruleMetadataLoader.addRulesByAnnotatedClass(repository, checks); + EcoCodeRule.addOnRepository(repository, TypeScriptRuleRepository.OLD_KEY, checks); repository.done(); } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidBrightnessOverride.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidBrightnessOverride.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidBrightnessOverride.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidBrightnessOverride.java index 19868c6..f95d3e7 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidBrightnessOverride.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidBrightnessOverride.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = AvoidBrightnessOverride.RULE_KEY) +@EcoCodeRule.Key("EC522") public class AvoidBrightnessOverride implements EslintBasedCheck { - public static final String RULE_KEY = "EC522"; + public static final String RULE_KEY = "GCI522"; @Override public String eslintKey() { - return "@ecocode/avoid-brightness-override"; + return "@creedengo/avoid-brightness-override"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidCSSAnimations.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidCSSAnimations.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidCSSAnimations.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidCSSAnimations.java index 68f4434..623c5c2 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidCSSAnimations.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidCSSAnimations.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = AvoidCSSAnimations.RULE_KEY) +@EcoCodeRule.Key("EC29") public class AvoidCSSAnimations implements EslintBasedCheck { - public static final String RULE_KEY = "EC29"; + public static final String RULE_KEY = "GCI29"; @Override public String eslintKey() { - return "@ecocode/avoid-css-animations"; + return "@creedengo/avoid-css-animations"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidHighAccuracyGeolocation.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidHighAccuracyGeolocation.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidHighAccuracyGeolocation.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidHighAccuracyGeolocation.java index 21b9ac9..2df5f55 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/AvoidHighAccuracyGeolocation.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/AvoidHighAccuracyGeolocation.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,25 +15,25 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; @JavaScriptRule @TypeScriptRule @Rule(key = AvoidHighAccuracyGeolocation.RULE_KEY) -@DeprecatedRuleKey(ruleKey = "EC8") +@EcoCodeRule.Key("EC8") public class AvoidHighAccuracyGeolocation implements EslintBasedCheck { - public static final String RULE_KEY = "EC523"; + public static final String RULE_KEY = "GCI523"; @Override public String eslintKey() { - return "@ecocode/avoid-high-accuracy-geolocation"; + return "@creedengo/avoid-high-accuracy-geolocation"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/LimitDbQueryResult.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/LimitDbQueryResult.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/LimitDbQueryResult.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/LimitDbQueryResult.java index 0597589..8112fb7 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/LimitDbQueryResult.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/LimitDbQueryResult.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = LimitDbQueryResult.RULE_KEY) +@EcoCodeRule.Key("EC24") public class LimitDbQueryResult implements EslintBasedCheck { - public static final String RULE_KEY = "EC24"; + public static final String RULE_KEY = "GCI24"; @Override public String eslintKey() { - return "@ecocode/limit-db-query-results"; + return "@creedengo/limit-db-query-results"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoEmptyImageSrcAttribute.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoEmptyImageSrcAttribute.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoEmptyImageSrcAttribute.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoEmptyImageSrcAttribute.java index d99063f..1a0a692 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoEmptyImageSrcAttribute.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoEmptyImageSrcAttribute.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = NoEmptyImageSrcAttribute.RULE_KEY) +@EcoCodeRule.Key("EC25") public class NoEmptyImageSrcAttribute implements EslintBasedCheck { - public static final String RULE_KEY = "EC25"; + public static final String RULE_KEY = "GCI25"; @Override public String eslintKey() { - return "@ecocode/no-empty-image-src-attribute"; + return "@creedengo/no-empty-image-src-attribute"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoImportAllFromLibrary.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoImportAllFromLibrary.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoImportAllFromLibrary.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoImportAllFromLibrary.java index c6531bc..ef30357 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoImportAllFromLibrary.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoImportAllFromLibrary.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = NoImportAllFromLibrary.RULE_KEY) +@EcoCodeRule.Key("EC9") public class NoImportAllFromLibrary implements EslintBasedCheck { - public static final String RULE_KEY = "EC9"; + public static final String RULE_KEY = "GCI9"; @Override public String eslintKey() { - return "@ecocode/no-import-all-from-library"; + return "@creedengo/no-import-all-from-library"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoMultipleAccessDomElement.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoMultipleAccessDomElement.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoMultipleAccessDomElement.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoMultipleAccessDomElement.java index 21ef28f..4ed834c 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoMultipleAccessDomElement.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoMultipleAccessDomElement.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = NoMultipleAccessDomElement.RULE_KEY) +@EcoCodeRule.Key("EC11") public class NoMultipleAccessDomElement implements EslintBasedCheck { - public static final String RULE_KEY = "EC11"; + public static final String RULE_KEY = "GCI11"; @Override public String eslintKey() { - return "@ecocode/no-multiple-access-dom-element"; + return "@creedengo/no-multiple-access-dom-element"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoMultipleStyleChanges.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoMultipleStyleChanges.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoMultipleStyleChanges.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoMultipleStyleChanges.java index 15d4e10..3c1b483 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoMultipleStyleChanges.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoMultipleStyleChanges.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = NoMultipleStyleChanges.RULE_KEY) +@EcoCodeRule.Key("EC12") public class NoMultipleStyleChanges implements EslintBasedCheck { - public static final String RULE_KEY = "EC12"; + public static final String RULE_KEY = "GCI12"; @Override public String eslintKey() { - return "@ecocode/no-multiple-style-changes"; + return "@creedengo/no-multiple-style-changes"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoTorch.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoTorch.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoTorch.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoTorch.java index 580686a..dc73a89 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/NoTorch.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/NoTorch.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = NoTorch.RULE_KEY) +@EcoCodeRule.Key("EC530") public class NoTorch implements EslintBasedCheck { - public static final String RULE_KEY = "EC530"; + public static final String RULE_KEY = "GCI530"; @Override public String eslintKey() { - return "@ecocode/no-torch"; + return "@creedengo/no-torch"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/PreferCollectionsWithPagination.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/PreferCollectionsWithPagination.java similarity index 68% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/PreferCollectionsWithPagination.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/PreferCollectionsWithPagination.java index 8620990..b1fdb90 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/PreferCollectionsWithPagination.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/PreferCollectionsWithPagination.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,21 +15,23 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.TypeScriptRule; @TypeScriptRule @Rule(key = PreferCollectionsWithPagination.RULE_KEY) +@EcoCodeRule.Key("EC13") public class PreferCollectionsWithPagination implements EslintBasedCheck { - public static final String RULE_KEY = "EC13"; + public static final String RULE_KEY = "GCI13"; @Override public String eslintKey() { - return "@ecocode/prefer-collections-with-pagination"; + return "@creedengo/prefer-collections-with-pagination"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/PreferShorthandCSSNotations.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/PreferShorthandCSSNotations.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/PreferShorthandCSSNotations.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/PreferShorthandCSSNotations.java index 8026f3a..d50d4d9 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/PreferShorthandCSSNotations.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/PreferShorthandCSSNotations.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = PreferShorthandCSSNotations.RULE_KEY) +@EcoCodeRule.Key("EC26") public class PreferShorthandCSSNotations implements EslintBasedCheck { - public static final String RULE_KEY = "EC26"; + public static final String RULE_KEY = "GCI26"; @Override public String eslintKey() { - return "@ecocode/prefer-shorthand-css-notations"; + return "@creedengo/prefer-shorthand-css-notations"; } } diff --git a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/ProvidePrintCSS.java b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/ProvidePrintCSS.java similarity index 70% rename from sonar-plugin/src/main/java/io/ecocode/javascript/checks/ProvidePrintCSS.java rename to sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/ProvidePrintCSS.java index e6a14fd..b068285 100644 --- a/sonar-plugin/src/main/java/io/ecocode/javascript/checks/ProvidePrintCSS.java +++ b/sonar-plugin/src/main/java/org/greencodeinitiative/creedengo/javascript/checks/ProvidePrintCSS.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,8 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript.checks; +package org.greencodeinitiative.creedengo.javascript.checks; +import org.greencodeinitiative.creedengo.javascript.EcoCodeRule; import org.sonar.check.Rule; import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -25,13 +26,14 @@ @JavaScriptRule @TypeScriptRule @Rule(key = ProvidePrintCSS.RULE_KEY) +@EcoCodeRule.Key("EC30") public class ProvidePrintCSS implements EslintBasedCheck { - public static final String RULE_KEY = "EC30"; + public static final String RULE_KEY = "GCI30"; @Override public String eslintKey() { - return "@ecocode/provide-print-css"; + return "@creedengo/provide-print-css"; } } diff --git a/sonar-plugin/src/main/resources/io/ecocode/profiles/ecocode_javascript_profile.json b/sonar-plugin/src/main/resources/io/ecocode/profiles/ecocode_javascript_profile.json deleted file mode 100644 index 32670fe..0000000 --- a/sonar-plugin/src/main/resources/io/ecocode/profiles/ecocode_javascript_profile.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "ecoCode", - "ruleKeys": [ - "EC9", - "EC11", - "EC12", - "EC24", - "EC25", - "EC26", - "EC29", - "EC30", - "EC523", - "EC530" - ] -} diff --git a/sonar-plugin/src/main/resources/io/ecocode/profiles/ecocode_typescript_profile.json b/sonar-plugin/src/main/resources/io/ecocode/profiles/ecocode_typescript_profile.json deleted file mode 100644 index 33577ce..0000000 --- a/sonar-plugin/src/main/resources/io/ecocode/profiles/ecocode_typescript_profile.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ecoCode", - "ruleKeys": [ - "EC13" - ] -} diff --git a/sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/javascript_profile.json b/sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/javascript_profile.json new file mode 100644 index 0000000..fb40792 --- /dev/null +++ b/sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/javascript_profile.json @@ -0,0 +1,15 @@ +{ + "name": "Creedengo", + "ruleKeys": [ + "GCI9", + "GCI11", + "GCI12", + "GCI24", + "GCI25", + "GCI26", + "GCI29", + "GCI30", + "GCI523", + "GCI530" + ] +} diff --git a/sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/typescript_profile.json b/sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/typescript_profile.json new file mode 100644 index 0000000..92a9900 --- /dev/null +++ b/sonar-plugin/src/main/resources/org/greencodeinitiative/creedengo/profiles/typescript_profile.json @@ -0,0 +1,4 @@ +{ + "name": "Creedengo", + "ruleKeys": ["GCI13"] +} diff --git a/sonar-plugin/src/test/java/io/ecocode/javascript/CheckListTest.java b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/CheckListTest.java similarity index 80% rename from sonar-plugin/src/test/java/io/ecocode/javascript/CheckListTest.java rename to sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/CheckListTest.java index ce12b82..cedfcd4 100644 --- a/sonar-plugin/src/test/java/io/ecocode/javascript/CheckListTest.java +++ b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/CheckListTest.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.junit.jupiter.api.Test; import org.sonar.check.Rule; @@ -32,7 +32,7 @@ public void check() throws ReflectiveOperationException { assertThat(checkClass).isAssignableTo(EslintBasedCheck.class); assertThat(checkClass).hasAnnotation(Rule.class); EslintBasedCheck check = (EslintBasedCheck) checkClass.getDeclaredConstructor().newInstance(); - assertThat(check.eslintKey()).startsWith("@ecocode/"); + assertThat(check.eslintKey()).startsWith("@creedengo/"); } } diff --git a/sonar-plugin/src/test/java/io/ecocode/javascript/ESLintRulesBundleTest.java b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/ESLintRulesBundleTest.java similarity index 73% rename from sonar-plugin/src/test/java/io/ecocode/javascript/ESLintRulesBundleTest.java rename to sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/ESLintRulesBundleTest.java index 350ad6b..4a96676 100644 --- a/sonar-plugin/src/test/java/io/ecocode/javascript/ESLintRulesBundleTest.java +++ b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/ESLintRulesBundleTest.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ public class ESLintRulesBundleTest { @Test public void create() { ESLintRulesBundle bundle = new ESLintRulesBundle(); - assertThat(bundle.bundlePath()).isEqualTo("/ecocode-eslint-plugin.tgz"); + assertThat(bundle.bundlePath()).isEqualTo("/creedengo-eslint-plugin.tgz"); } } diff --git a/sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptPluginTest.java b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptPluginTest.java similarity index 82% rename from sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptPluginTest.java rename to sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptPluginTest.java index d300974..c6d07b9 100644 --- a/sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptPluginTest.java +++ b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptPluginTest.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.junit.jupiter.api.Test; import org.sonar.api.Plugin; diff --git a/sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptRuleRepositoryTest.java b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRuleRepositoryTest.java similarity index 78% rename from sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptRuleRepositoryTest.java rename to sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRuleRepositoryTest.java index d7dd4c8..849159a 100644 --- a/sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptRuleRepositoryTest.java +++ b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRuleRepositoryTest.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.junit.jupiter.api.Test; import org.sonar.plugins.javascript.api.CustomRuleRepository; @@ -28,7 +28,7 @@ public class JavaScriptRuleRepositoryTest { public void create() { JavaScriptRuleRepository repository = new JavaScriptRuleRepository(); assertThat(repository.languages()).containsExactlyInAnyOrder(CustomRuleRepository.Language.JAVASCRIPT, CustomRuleRepository.Language.TYPESCRIPT); - assertThat(repository.repositoryKey()).isEqualTo("ecocode-javascript"); + assertThat(repository.repositoryKey()).isEqualTo("creedengo-javascript"); assertThat(repository.checkClasses()).isNotEmpty(); } diff --git a/sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptRulesDefinitionTest.java b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRulesDefinitionTest.java similarity index 83% rename from sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptRulesDefinitionTest.java rename to sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRulesDefinitionTest.java index e00cc74..bdc3546 100644 --- a/sonar-plugin/src/test/java/io/ecocode/javascript/JavaScriptRulesDefinitionTest.java +++ b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/JavaScriptRulesDefinitionTest.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.junit.jupiter.api.Test; import org.sonar.api.SonarRuntime; @@ -40,7 +40,7 @@ void createRepository() { RulesDefinition.Repository repository = context.repositories().get(0); assertThat(repository.isExternal()).isFalse(); assertThat(repository.language()).isEqualTo("js"); - assertThat(repository.key()).isEqualTo("ecocode-javascript"); + assertThat(repository.key()).isEqualTo("creedengo-javascript"); } } diff --git a/sonar-plugin/src/test/java/io/ecocode/javascript/TypeScriptRuleRepositoryTest.java b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRuleRepositoryTest.java similarity index 77% rename from sonar-plugin/src/test/java/io/ecocode/javascript/TypeScriptRuleRepositoryTest.java rename to sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRuleRepositoryTest.java index c6b402d..f820f18 100644 --- a/sonar-plugin/src/test/java/io/ecocode/javascript/TypeScriptRuleRepositoryTest.java +++ b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRuleRepositoryTest.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.junit.jupiter.api.Test; import org.sonar.plugins.javascript.api.CustomRuleRepository; @@ -28,7 +28,7 @@ public class TypeScriptRuleRepositoryTest { public void create() { TypeScriptRuleRepository repository = new TypeScriptRuleRepository(); assertThat(repository.languages()).containsExactlyInAnyOrder(CustomRuleRepository.Language.TYPESCRIPT); - assertThat(repository.repositoryKey()).isEqualTo("ecocode-typescript"); + assertThat(repository.repositoryKey()).isEqualTo("creedengo-typescript"); assertThat(repository.checkClasses()).isNotEmpty(); } diff --git a/sonar-plugin/src/test/java/io/ecocode/javascript/TypeScriptRulesDefinitionTest.java b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRulesDefinitionTest.java similarity index 83% rename from sonar-plugin/src/test/java/io/ecocode/javascript/TypeScriptRulesDefinitionTest.java rename to sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRulesDefinitionTest.java index a8f0786..bd4c194 100644 --- a/sonar-plugin/src/test/java/io/ecocode/javascript/TypeScriptRulesDefinitionTest.java +++ b/sonar-plugin/src/test/java/org/greencodeinitiative/creedengo/javascript/TypeScriptRulesDefinitionTest.java @@ -1,6 +1,6 @@ /* - * ecoCode JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs - * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * Creedengo JavaScript plugin - Provides rules to reduce the environmental footprint of your JavaScript programs + * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package io.ecocode.javascript; +package org.greencodeinitiative.creedengo.javascript; import org.junit.jupiter.api.Test; import org.sonar.api.SonarRuntime; @@ -40,7 +40,7 @@ void createRepository() { RulesDefinition.Repository repository = context.repositories().get(0); assertThat(repository.isExternal()).isFalse(); assertThat(repository.language()).isEqualTo("ts"); - assertThat(repository.key()).isEqualTo("ecocode-typescript"); + assertThat(repository.key()).isEqualTo("creedengo-typescript"); } } diff --git a/sonar-project.properties b/sonar-project.properties index 567a9c1..1cc39a7 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ sonar.organization=green-code-initiative sonar.projectKey=green-code-initiative_ecoCode-linter -sonar.projectName=ecoCode - JavaScript language +sonar.projectName=creedengo - JavaScript language sonar.sources=eslint-plugin/lib/,sonar-plugin/src/main/java/ sonar.tests=eslint-plugin/tests/,sonar-plugin/src/test/java/ sonar.javascript.lcov.reportPaths=eslint-plugin/coverage/lcov.info