Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
dedece35 authored Sep 22, 2023
2 parents d2e99d2 + 67e93e7 commit 6785bbf
Show file tree
Hide file tree
Showing 295 changed files with 4,916 additions and 5,568 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
paths-ignore:
- '*.md'
- '.github/**/*.yml'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
types: [opened, synchronize, reopened]
jobs:
Expand Down
63 changes: 0 additions & 63 deletions .github/workflows/manual_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,66 +89,3 @@ jobs:
asset_path: lib/ecocode-java-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: ecocode-java-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_content_type: application/zip
upload-javascript:
name: Upload JavaScript Plugin
runs-on: ubuntu-latest
needs: build
steps:
- name: Import plugin JAR files
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
path: lib
- name: Upload Release Asset - JavaScript 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: lib/ecocode-javascript-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: ecocode-javascript-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_content_type: application/zip
upload-php:
name: Upload PHP Plugin
runs-on: ubuntu-latest
needs: build
steps:
- name: Import plugin JAR files
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
path: lib
- 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: lib/ecocode-php-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: ecocode-php-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_content_type: application/zip
upload-python:
name: Upload Python Plugin
runs-on: ubuntu-latest
needs: build
steps:
- name: Import plugin JAR files
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
path: lib
- name: Upload Release Asset - Python 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: lib/ecocode-python-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: ecocode-python-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_content_type: application/zip
56 changes: 56 additions & 0 deletions .github/workflows/publish_to_maven_central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow will build a Java project with Maven and publish artifact to Maven Central (https://search.maven.org)
#
# After deploy to https://s01.oss.sonatype.org finished, manual steps is required :
# - Go to: https://s01.oss.sonatype.org/#stagingRepositories
# - Check upload and if all is right, "Close" corresponding Staging Repository
# - "Release" corresponding Staging Repository
# - Wait some hours and then check availability of release on Maven central: https://search.maven.org/search?q=g:io.ecocode
#
# Additional information:
# - https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-maven#publishing-packages-to-the-maven-central-repository
# - https://blogs.itemis.com/en/github-actions-releasing-artifacts-into-maven-central

name: Publish package to the Maven Central Repository

on:
workflow_dispatch:

jobs:
publish:
name: Deploy to Maven central
runs-on: ubuntu-latest

steps:
# Checks out a copy of project's repository.
- name: Checkout
uses: actions/checkout@v3

# Sets up the Java JDK, and also configures the Maven `settings.xml` file to add authentication for the
# `ossrh` repository using the `OSSRH_USERNAME` and `OSSRH_TOKEN` environment variables.
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin in `pom.xml`
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Substituted with the value stored in the referenced secret
gpg-passphrase: MAVEN_GPG_PASSPHRASE # Env var that holds the key's passphrase

- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

# Runs the Maven command to publish to the `ossrh` repository.
# The `OSSRH_USERNAME` environment variable will be set with the contents of your `OSSRH_USERNAME` secret,
# and the `OSSRH_TOKEN` environment variable will be set with the contents of your `OSSRH_TOKEN` secret.
- name: Publish package
run: mvn --batch-mode deploy -Pmaven-central-publishing
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
21 changes: 21 additions & 0 deletions .github/workflows/stale_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Label stale PRs"
on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch:

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: -1 # We don't want to address issues
days-before-pr-stale: 30
days-before-issue-close: -1 # We don't want to close issues in this action
days-before-pr-close: -1 # We don't want to close PR in this action
stale-pr-label: stale
stale-pr-message: |
This PR has been automatically marked as stale because it has no activity for 30 days.
Please add a comment if you want to keep the issue open. Thank you for your contributions!
63 changes: 0 additions & 63 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,66 +69,3 @@ jobs:
asset_path: lib/ecocode-java-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-java-plugin-${{ github.ref_name }}.jar
asset_content_type: application/zip
upload-javascript:
name: Upload JavaScript Plugin
runs-on: ubuntu-latest
needs: build
steps:
- name: Import plugin JAR files
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
path: lib
- name: Upload Release Asset - JavaScript 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: lib/ecocode-javascript-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-javascript-plugin-${{ github.ref_name }}.jar
asset_content_type: application/zip
upload-php:
name: Upload PHP Plugin
runs-on: ubuntu-latest
needs: build
steps:
- name: Import plugin JAR files
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
path: lib
- 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: lib/ecocode-php-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-php-plugin-${{ github.ref_name }}.jar
asset_content_type: application/zip
upload-python:
name: Upload Python Plugin
runs-on: ubuntu-latest
needs: build
steps:
- name: Import plugin JAR files
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
path: lib
- name: Upload Release Asset - Python 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: lib/ecocode-python-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-python-plugin-${{ github.ref_name }}.jar
asset_content_type: application/zip
93 changes: 82 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,86 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- [#216](https://github.com/green-code-initiative/ecoCode/issues/216) Upgrade rule EC2 for Java : Multiple if-else statement improvment
- [#106](https://github.com/green-code-initiative/ecoCode/issues/106) Upgrade RULES.md : rule EC67 not relevant neither for Python nor Rust
- [#225](https://github.com/green-code-initiative/ecoCode/pull/225) Upgrade licence system and licence headers of Java files
- [#140](https://github.com/green-code-initiative/ecoCode/issues/140) Upgrade rule EC3 for Python : no implementation possible for python
- [#136](https://github.com/green-code-initiative/ecoCode/issues/136) Upgrade rule EC53 for Python : no implementation possible for python

### Deleted

## [1.4.0] - 2023-08-08

### Added

- [171](https://github.com/green-code-initiative/ecoCode/issues/171) Add migration mechanism to support "issue re-keying"
- [#205](https://github.com/green-code-initiative/ecoCode/issues/205) compatibility with SonarQube 10.1
- [#210](https://github.com/green-code-initiative/ecoCode/pull/210) Publish to Maven Central (module ecocode-rules-specifications)

### Changed
### Deleted

- [#182](https://github.com/green-code-initiative/ecoCode/issues/182) Split repository : move Python module to new `ecoCode-python` repository
- [#182](https://github.com/green-code-initiative/ecoCode/issues/182) Split repository : move Php module to new `ecoCode-php` repository

- [166](https://github.com/green-code-initiative/ecoCode/issues/166) Correction of wrong message of rule EC63
- [167](https://github.com/green-code-initiative/ecoCode/issues/167) Use same kind for rules across different languages
- [173](https://github.com/green-code-initiative/ecoCode/issues/173) Update issue description of rule EC34 (try-catch)
## [1.3.1] - 2023-07-19

### Added

- [#207](https://github.com/green-code-initiative/ecoCode/issues/207) Add release tag analyzis on SonarCloud

### Changed

### Deleted

- [#211](https://github.com/green-code-initiative/ecoCode/pull/211) Move JavaScript plugin to its dedicated repository

## [1.3.0] - 2023-07-04

### Added

- [#108](https://github.com/green-code-initiative/ecoCode/issues/108) new Python rule EC66 : Use single quote (') instead of quotation mark (")
- [#109](https://github.com/green-code-initiative/ecoCode/issues/109) new PHP rule EC3 : Getting the size of the collection in the loop. For further [RULES.md](./RULES.md) file
- [#113](https://github.com/green-code-initiative/ecoCode/issues/113) new Python rule EC10 : Use unoptimized vector images
- [#127](https://github.com/green-code-initiative/ecoCode/issues/127) new Python rule EC404 : Usage of generator comprehension instead of list comprehension in for loop declaration
- [#190](https://github.com/green-code-initiative/ecoCode/pull/190) Add Python rule: Use unoptimized vector images
- [#191](https://github.com/green-code-initiative/ecoCode/issues/191) Update rule tags for Java, Python, and PHP plugins
- [#192](https://github.com/green-code-initiative/ecoCode/pull/192) new Python rule EC203 : Detect unoptimized file formats
- Add JavaScript rules from [ecoCode ESLint plugin v0.2.0](https://github.com/green-code-initiative/ecoCode-linter/releases/tag/eslint-plugin%2F0.2.0)

### Changed

- [#19](https://github.com/green-code-initiative/ecoCode-common/issues/19) process changed for development environment installation : easier to initialize locally environment (check [`INSTALL.md`](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/INSTALL.md#howto-install-sonarqube-dev-environment) file)
- [#187](https://github.com/green-code-initiative/ecoCode/issues/187) upgrade librairies to SonarQube 10.0.0
- [#196](https://github.com/green-code-initiative/ecoCode/issues/196) updating PHP files to make them following the coding standards (PSR-12)
- [#201](https://github.com/green-code-initiative/ecoCode/pull/201) Clean-up plugins and dependencies
- technical : upgrade of maven plugins versions

## [1.2.1] - 2023-04-18

### Changed

- [#180](https://github.com/green-code-initiative/ecoCode/pull/180) correction of SonarQube review for MarketPlace (sonar plugin)

## [1.2.0] - 2023-04-14

### Added

- [#171](https://github.com/green-code-initiative/ecoCode/issues/171) Add migration mechanism to support "issue re-keying"

### Changed

- [#161](https://github.com/green-code-initiative/ecoCode/pull/161) Remove unnecessary junit dependencies in pom.xml
- [#166](https://github.com/green-code-initiative/ecoCode/issues/166) Correction of wrong message of rule EC63
- [#167](https://github.com/green-code-initiative/ecoCode/issues/167) Use same kind for rules across different languages
- [#173](https://github.com/green-code-initiative/ecoCode/issues/173) Update issue description of rule EC34 (try-catch)

## [1.1.0] - 2023-04-03

### Changed

- [#63](https://github.com/green-code-initiative/ecoCode/issues/63) Update plugins to be compliant for SonarQube MarketPlace integration ( PR [#79](https://github.com/green-code-initiative/ecoCode/pull/79) )
- [#88](https://github.com/green-code-initiative/ecoCode/pull/88) upgrade rules matrix with new ids + refactoring rules documentation (`RULES.md`)
- _*WARNING*_ : since this plugin version, ids of plugin rules changed. In consequence, if you have already made some issue checks in your SonarQube instance, you will have to do them again (example : false-positive issues will appear again)

### Deleted

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

- [#40](https://github.com/green-code-initiative/ecoCode/issues/40) Refactoring of package names (`cnumr` to `greencodeinitiative`)
- [#55](https://github.com/green-code-initiative/ecoCode/issues/55) rename `eco-conception` tag of rules to `eco-design`
- [#58](https://github.com/green-code-initiative/ecoCode/issues/58) check and upgrade compatibility to SonarQube 9.9
- move common init scripts to `ecoCode-common` repository
- modifying documentation and move `CONTRIBUTING.md`, `CODE_STYLE.md` and `INSTALL.md` to common doc in `ecoCode-common` repository
- security / performance optimizations : correction of `sonarcloud.io` security hotspots (java / php, python) and move Pattern compilation to static attribute
- [#64](https://github.com/green-code-initiative/ecoCode/issues/64) Python: ecoCode plugin with SonarQube, no code-smell detection
- [#65](https://github.com/green-code-initiative/ecoCode/issues/65) Create a test project to check new plugin rule in real environment
- [#71](https://github.com/green-code-initiative/ecoCode/issues/71) After an PHP analysis, no ecocode code smells appears in my Sonar project
- [#64](https://github.com/green-code-initiative/ecoCode/issues/64) Python: ecoCode plugin with SonarQube, no code-smell detection
- [#55](https://github.com/green-code-initiative/ecoCode/issues/55) rename `eco-conception` tag of rules to `eco-design`
- [#76](https://github.com/green-code-initiative/ecoCode/issues/76) correction of SonarQube plugins homepage link broken
- documentation upgrade

Expand All @@ -70,7 +131,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#33](https://github.com/green-code-initiative/ecoCode/issues/33) Update plugin description in code
- [#42](https://github.com/green-code-initiative/ecoCode/issues/42) Fix Crash SonarQube analysis because of some ClassCast Exceptions
- [#48](https://github.com/green-code-initiative/ecoCode/pull/48) correction SONAR issue info - delete public keyword on tests
- Improve "build" Github actions to execute checks on branches from fork repositories
- Improve "build" GitHub actions to execute checks on branches from fork repositories

## [0.2.1] - 2022-12-30

Expand Down Expand Up @@ -108,9 +169,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- First official release of ecocode plugins : java plugin, php plugin and python plugin

[unreleased]: https://github.com/green-code-initiative/ecoCode/compare/v1.1.0...HEAD
[unreleased]: https://github.com/green-code-initiative/ecoCode/compare/v1.4.0...HEAD

[1.4.0]: https://github.com/green-code-initiative/ecoCode/compare/v1.3.1...v1.4.0

[1.3.1]: https://github.com/green-code-initiative/ecoCode/compare/v1.3.0...v1.3.1

[1.3.0]: https://github.com/green-code-initiative/ecoCode/compare/v1.2.1...v1.3.0

[1.2.1]: https://github.com/green-code-initiative/ecoCode/compare/v1.2.0...v1.2.1

[1.2.0]: https://github.com/green-code-initiative/ecoCode/compare/v1.1.0...v1.2.0

[1.0.0]: https://github.com/green-code-initiative/ecoCode/compare/v1.0.0...v1.1.0
[1.1.0]: https://github.com/green-code-initiative/ecoCode/compare/v1.0.0...v1.1.0

[1.0.0]: https://github.com/green-code-initiative/ecoCode/compare/v0.2.2...v1.0.0

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ COPY . /usr/src/ecocode
WORKDIR /usr/src/ecocode
RUN ./tool_build.sh

FROM sonarqube:9.9-community
FROM sonarqube:10.1.0-community
COPY --from=builder /usr/src/ecocode/lib/* /opt/sonarqube/extensions/plugins/
Loading

0 comments on commit 6785bbf

Please sign in to comment.