Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lmangaretto renommage PHP #38

Merged
merged 11 commits into from
Dec 16, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_ecoCode-php
run: mvn -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_creedengo-php
4 changes: 2 additions & 2 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ on:
# - main

env:
IMAGE_NAME: sonarqube-ecocode-php
IMAGE_NAME: sonarqube-creedengo-php
IMAGES: |
ghcr.io/${{ github.repository_owner }}/sonarqube-ecocode-php
ghcr.io/${{ github.repository_owner }}/sonarqube-creedengo-php

jobs:
Build:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/manual_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ jobs:
id: export_jar_files
uses: actions/upload-artifact@v3
with:
name: ecocode-plugins
path: target/ecocode-php-plugin-${{ env.LAST_TAG }}.jar
name: creedengo-plugins
path: target/creedengo-php-plugin-${{ env.LAST_TAG }}.jar
- name: Export LAST_TAG
id: export_last_tag
run: echo "last_tag=${{ env.LAST_TAG }}" >> $GITHUB_OUTPUT
Expand All @@ -80,16 +80,16 @@ jobs:
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
path: target/ecocode-php-plugin-${{ needs.build.outputs.last_tag }}.jar
name: creedengo-plugins
path: target/creedengo-php-plugin-${{ needs.build.outputs.last_tag }}.jar
- name: Upload Release Asset - PHP Plugin
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.build.outputs.upload_url }}
asset_path: target/ecocode-php-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: ecocode-php-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_path: target/creedengo-php-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: creedengo-php-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_content_type: application/zip

8 changes: 4 additions & 4 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
id: export_jar_files
uses: actions/upload-artifact@v3
with:
name: ecocode-plugins
name: creedengo-plugins
path: target
- name: Export UPLOAD_URL
id: export_upload_url
Expand All @@ -65,7 +65,7 @@ jobs:
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
name: creedengo-plugins
path: target
- name: Upload Release Asset - PHP Plugin
id: upload-release-asset
Expand All @@ -74,6 +74,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.build.outputs.upload_url}}
asset_path: target/ecocode-php-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-php-plugin-${{ github.ref_name }}.jar
asset_path: target/creedengo-php-plugin-${{ github.ref_name }}.jar
asset_name: creedengo-php-plugin-${{ github.ref_name }}.jar
asset_content_type: application/zip
42 changes: 21 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [#34](https://github.com/green-code-initiative/ecoCode-php/issues/34) Add test to ensure all Rules are registered
- [#34](https://github.com/green-code-initiative/creedengo-php/issues/34) Add test to ensure all Rules are registered

### Deleted

Expand All @@ -26,35 +26,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- upgrade docker system
- [#30](https://github.com/green-code-initiative/ecoCode-php/issues/30) Upgrade dependencies to latest ones - technical
- [#30](https://github.com/green-code-initiative/creedengo-php/issues/30) Upgrade dependencies to latest ones - technical
incompatibilities for SonarQube before 9.9 version
- clean unit test files (to have less other issues)

## [1.4.4] - 2024-07-19

### Changed

- [#28](https://github.com/green-code-initiative/ecoCode-php/issues/28) Add support for SonarQube 10.6.0
- [#28](https://github.com/green-code-initiative/creedengo-php/issues/28) Add support for SonarQube 10.6.0

## [1.4.3] - 2024-05-15

### Added

- [#20](https://github.com/green-code-initiative/ecoCode-php/issues/20) Add support for SonarQube 10.4 "
- [#20](https://github.com/green-code-initiative/creedengo-php/issues/20) Add support for SonarQube 10.4 "
DownloadOnlyWhenRequired" feature

### Changed

- [#23](https://github.com/green-code-initiative/ecoCode-php/issues/23) deprecation of EC22 rule for PHP (waiting for
- [#23](https://github.com/green-code-initiative/creedengo-php/issues/23) deprecation of EC22 rule for PHP (waiting for
measurement to prove it)
- check Sonarqube 10.5.1 compatibility + update docker files and README.md

## [1.4.2] - 2024-01-12

### Changed

- [#17](https://github.com/green-code-initiative/ecoCode-php/issues/17) Correction of error with deprecated EC34 rule
- Update ecocode-rules-specifications to 1.4.7
- [#17](https://github.com/green-code-initiative/creedengo-php/issues/17) Correction of error with deprecated EC34 rule
- Update creedengo-rules-specifications to 1.4.7

## [1.4.1] - 2024-01-06

Expand All @@ -64,29 +64,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [#9](https://github.com/green-code-initiative/ecoCode-php/pull/9) Upgrade licence system and licence headers of Java
- [#9](https://github.com/green-code-initiative/creedengo-php/pull/9) Upgrade licence system and licence headers of Java
files
- [#10](https://github.com/green-code-initiative/ecoCode-php/pull/10) Adding EC35 rule : EC35 rule replaces EC34 with a
- [#10](https://github.com/green-code-initiative/creedengo-php/pull/10) Adding EC35 rule : EC35 rule replaces EC34 with a
specific use case ("file not found" specific)
- [#13](https://github.com/green-code-initiative/ecoCode-php/issues/13) Add build number to manifest
- [#12](https://github.com/green-code-initiative/ecoCode-php/issues/12) Fix unit tests execution with Maven
- Update ecocode-rules-specifications to 1.4.6
- [#13](https://github.com/green-code-initiative/creedengo-php/issues/13) Add build number to manifest
- [#12](https://github.com/green-code-initiative/creedengo-php/issues/12) Fix unit tests execution with Maven
- Update creedengo-rules-specifications to 1.4.6
- README.md upgrade : docker test environment

## [1.4.0] - 2023-08-08

### Added

- PHP rules moved from `ecoCode` repository to current repository
- [#121](https://github.com/green-code-initiative/ecoCode/issues/121) new PHP rule : Multiple if-else statement +
- PHP rules moved from `creedengo` repository to current repository
- [#121](https://github.com/green-code-initiative/creedengo/issues/121) new PHP rule : Multiple if-else statement +
dedece35 marked this conversation as resolved.
Show resolved Hide resolved
refactoring implementation
- [#205](https://github.com/green-code-initiative/ecoCode/issues/205) compatibility with SonarQube 10.1
- [#205](https://github.com/green-code-initiative/creedengo/issues/205) compatibility with SonarQube 10.1

## Comparison list

[unreleased](https://github.com/green-code-initiative/ecoCode-php/compare/1.4.4...HEAD)
[1.4.4](https://github.com/green-code-initiative/ecoCode-php/compare/1.4.3...1.4.4)
[1.4.3](https://github.com/green-code-initiative/ecoCode-php/compare/1.4.2...1.4.3)
[1.4.2](https://github.com/green-code-initiative/ecoCode-php/compare/1.4.1...1.4.2)
[1.4.1](https://github.com/green-code-initiative/ecoCode-php/compare/1.4.0...1.4.1)
[1.4.0](https://github.com/green-code-initiative/ecoCode-php/releases/tag/1.4.0)
[unreleased](https://github.com/green-code-initiative/creedengo-php/compare/1.4.4...HEAD)
[1.4.4](https://github.com/green-code-initiative/creedengo-php/compare/1.4.3...1.4.4)
[1.4.3](https://github.com/green-code-initiative/creedengo-php/compare/1.4.2...1.4.3)
[1.4.2](https://github.com/green-code-initiative/creedengo-php/compare/1.4.1...1.4.2)
[1.4.1](https://github.com/green-code-initiative/creedengo-php/compare/1.4.0...1.4.1)
[1.4.0](https://github.com/green-code-initiative/creedengo-php/releases/tag/1.4.0)
2 changes: 1 addition & 1 deletion CODE_STYLE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please read common [CODE_STYLE.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/CODE_STYLE.md) in `ecoCode-common` repository.
Please read common [CODE_STYLE.md](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/CODE_STYLE.md) in `creedengo-common` repository.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please read common [CONTRIBUTING.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/CONTRIBUTING.md) in `ecoCode-common` repository.
Please read common [CONTRIBUTING.md](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/CONTRIBUTING.md) in `creedengo-common` repository.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ ARG SONARQUBE_VERSION=10.6.0-community

FROM maven:${MAVEN_BUILDER} AS builder

COPY . /usr/src/ecocode
COPY . /usr/src/creedengo

WORKDIR /usr/src/ecocode
WORKDIR /usr/src/creedengo
COPY src src/
COPY pom.xml tool_build.sh ./

RUN ./tool_build.sh

FROM sonarqube:${SONARQUBE_VERSION}
COPY --from=builder /usr/src/ecocode/target/ecocode-*.jar /opt/sonarqube/extensions/plugins/
COPY --from=builder /usr/src/creedengo/target/creedengo-*.jar /opt/sonarqube/extensions/plugins/
USER sonarqube
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Common installation notes / requirements
========================================

Please read common [INSTALL.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/INSTALL.md)
in `ecoCode-common` repository. Please follow the specific guides below for additional information on installing the
Please read common [INSTALL.md](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/INSTALL.md)
in `creedengo-common` repository. Please follow the specific guides below for additional information on installing the
desired plugins.

Special points for Standard plugins
Expand All @@ -14,7 +14,7 @@ Project structure
Here is a preview of project tree :

```txt
ecoCode-php # Root directory
creedengo-php # Root directory
|
+--src # source directory
|
Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
EcoCode-php
creedengo-php
===========

_ecoCode_ is a collective project aiming to reduce environmental footprint of software at the code level. The goal of
_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.

_ecoCode_ is based on evolving catalogs
of [good practices](https://github.com/green-code-initiative/ecoCode/blob/main/docs/rules), for various technologies.
_creedengo_ is based on evolving catalogs
of [good practices](https://github.com/green-code-initiative/creedengo/blob/main/docs/rules), for various technologies.
This
SonarQube plugin then implements these catalogs as rules for scanning your PHP projects.

> ⚠️ This is still a very early stage project. Any feedback or contribution will be highly appreciated. Please
> refer to the contribution section.

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/CODE_OF_CONDUCT.md)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/CODE_OF_CONDUCT.md)

🌿 SonarQube Plugins
-------------------

This plugin is part of the ecoCode project.\
This plugin is part of the creedengo project.\
You can find a list of all our other plugins in
the [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-sonarqube-plugins)
the [creedengo repository](https://github.com/green-code-initiative/creedengo#-sonarqube-plugins)

🚀 Getting Started
------------------
Expand All @@ -31,34 +31,34 @@ You can give a try with a one command docker :
```sh
docker run -ti --rm \
-p 9000:9000 \
--name sonarqube-ecocode-php ghcr.io/green-code-initiative/sonarqube-ecocode-php:latest
--name sonarqube-creedengo-php ghcr.io/green-code-initiative/sonarqube-creedengo-php:latest
```

or (with logs and data locally stored) :

```sh
docker run -ti --rm \
-v sq_ecocode_logs:/opt/sonarqube/logs \
-v sq_ecocode_data:/opt/sonarqube/data \
-v sq_creedengo_logs:/opt/sonarqube/logs \
-v sq_creedengo_data:/opt/sonarqube/data \
-p 9000:9000 \
--name sonarqube-ecocode-php ghcr.io/green-code-initiative/sonarqube-ecocode-php:latest
--name sonarqube-creedengo-php ghcr.io/green-code-initiative/sonarqube-creedengo-php:latest
```

... and configure local SonarQube (security config and quality profile : see [configuration](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/INSTALL.md#configuration-sonarqube) for more details).
... and configure local SonarQube (security config and quality profile : see [configuration](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/INSTALL.md#configuration-sonarqube) for more details).

To install other `ecocode` plugins, you can also :
To install other `creedengo` plugins, you can also :

- download each plugin separatly and copy the plugin (jar file) to `$SONAR_INSTALL_DIR/extensions/plugins` and restart SonarQube.
- install different ecocode plugins with Marketplace (inside admin panel of SonarQube)
- install different creedengo plugins with Marketplace (inside admin panel of SonarQube)

Then you can use PHP test project repository to test the environment : see README.md of [PHP test project](https://github.com/green-code-initiative/ecoCode-php-test-project)
Then you can use PHP test project repository to test the environment : see README.md of [PHP test project](https://github.com/green-code-initiative/creedengo-php-test-project)

Finally, you can directly use a [all-in-one docker-compose](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/INSTALL.md#start-sonarqube-if-first-time)
Finally, you can directly use a [all-in-one docker-compose](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/INSTALL.md#start-sonarqube-if-first-time)

🛒 Distribution
------------------

Ready to use binaries are available [from GitHub](https://github.com/green-code-initiative/ecoCode-php/releases).
Ready to use binaries are available [from GitHub](https://github.com/green-code-initiative/creedengo-php/releases).

🧩 Compatibility
-----------------
Expand All @@ -69,17 +69,17 @@ Ready to use binaries are available [from GitHub](https://github.com/green-code-
| 1.5.+ | 9.9.+ to 10.6.0 | 17 |

> Compatibility table of versions lower than 1.4.+ are available from the
> main [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-plugins-version-compatibility).
> main [creedengo repository](https://github.com/green-code-initiative/creedengo#-plugins-version-compatibility).

🤝 Contribution
---------------

check [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-contribution)
check [creedengo repository](https://github.com/green-code-initiative/creedengo#-contribution)

🤓 Main contributors
--------------------

check [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-main-contributors)
check [creedengo repository](https://github.com/green-code-initiative/creedengo#-main-contributors)

Links
-----
Expand Down
2 changes: 1 addition & 1 deletion RULES.md
Original file line number Diff line number Diff line change
@@ -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/blob/main/RULES.md) in `creedengo` repository.
2 changes: 1 addition & 1 deletion TODOs_DDC.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TODOS dev DDC

actions vues en séance weekly-meeting :

- ecoCode-android : nettoyer packages (suite au release)
- creedengo-android : nettoyer packages (suite au release)

actions vues perso :

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: sonarqube_ecocode_php
name: sonarqube_creedengo_php

services:
sonar:
build: .
container_name: sonar_ecocode_php
container_name: sonar_creedengo_php
ports:
- ":9000"
networks:
Expand All @@ -28,7 +28,7 @@ services:

db:
image: postgres:12
container_name: postgresql_ecocode_php
container_name: postgresql_creedengo_php
networks:
- sonarnet
volumes:
Expand Down
Loading
Loading