Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

# Ensure BAT files will always be checked out with CRLFs (regardless of the
# OS they were checked out on).
*.bat text eol=crlf
*.bat text eol=crlf

# Ensure BAT files will always be checked out with CRLFs (regardless of the
# OS they were checked out on).
*.cmd text eol=crlf
14 changes: 7 additions & 7 deletions .github/workflows/_BACKUP_manual_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
git config user.name 'github-actions[bot]'
git config user.email ''
- name: Maven release
run: mvn release:prepare -B -ff -DtagNameFormat=@{project.version}
run: ./mvnw release:prepare -B -ff -DtagNameFormat=@{project.version}
- name: Maven release clean
run: mvn release:clean
run: ./mvnw release:clean
- name: Get last TAG
run: echo "LAST_TAG=$(git tag --sort=-version:refname | head -n 1)" >> $GITHUB_ENV
- name: Extract release notes
Expand All @@ -44,7 +44,7 @@ jobs:
with:
ref: ${{ env.LAST_TAG }}
- name: Build project
run: mvn -e -B clean package -DskipTests
run: ./mvnw -e -B clean package -DskipTests
- name: Create release
id: create_release
uses: actions/create-release@v1
Expand All @@ -60,7 +60,7 @@ jobs:
id: export_jar_files
uses: actions/upload-artifact@v3
with:
name: ecocode-plugins
name: creedengo-plugins
path: lib
- name: Export LAST_TAG
id: export_last_tag
Expand All @@ -77,7 +77,7 @@ jobs:
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
name: creedengo-plugins
path: lib
- name: Upload Release Asset - Java Plugin
id: upload-release-asset
Expand All @@ -86,6 +86,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.build.outputs.upload_url}}
asset_path: lib/ecocode-java-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: ecocode-java-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_path: lib/creedengo-java-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: creedengo-java-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_content_type: application/zip
14 changes: 4 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 17

- name: Cache Maven packages
uses: actions/cache@v3
Expand All @@ -38,13 +38,7 @@ jobs:
restore-keys: ${{ runner.os }}-m2

- name: Verify
run: mvn -e -B verify

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
run: ./mvnw -e -B verify

- name: Cache SonarQube packages
uses: actions/cache@v3
Expand All @@ -57,4 +51,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-java
run: ./mvnw -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_creedengo-java
8 changes: 4 additions & 4 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ on:

env:
# github.repository as <account>/<repo>
# IMAGE_NAME: sonarqube-ecocode
# IMAGE_NAME: sonarqube-creedengo
# IMAGES: |
# ghcr.io/${{ github.repository_owner }}/sonarqube-ecocode
IMAGE_NAME: sonarqube-ecocode-java
# ghcr.io/${{ github.repository_owner }}/sonarqube-creedengo
IMAGE_NAME: sonarqube-creedengo-java
IMAGES: |
ghcr.io/${{ github.repository_owner }}/sonarqube-ecocode-java
ghcr.io/${{ github.repository_owner }}/sonarqube-creedengo-java

jobs:
Build:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Build project
run: mvn -e -B clean package -DskipTests
run: ./mvnw -e -B clean package -DskipTests
- name: Create release
id: create_release
uses: actions/create-release@v1
Expand All @@ -43,9 +43,9 @@ jobs:
body: ${{ steps.extract-release-notes.outputs.release_notes }}
- name: Export plugin Jar files
id: export_jar_files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ecocode-plugins
name: creedengo-plugins
path: target
- name: Export UPLOAD_URL
id: export_upload_url
Expand All @@ -58,9 +58,9 @@ jobs:
steps:
- name: Import plugin JAR files
id: import_jar_files
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ecocode-plugins
name: creedengo-plugins
path: target
- name: Upload Release Asset - Java Plugin
id: upload-release-asset
Expand All @@ -69,6 +69,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.build.outputs.upload_url}}
asset_path: target/ecocode-java-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-java-plugin-${{ github.ref_name }}.jar
asset_path: target/creedengo-java-plugin-${{ github.ref_name }}.jar
asset_name: creedengo-java-plugin-${{ github.ref_name }}.jar
asset_content_type: application/zip
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Ignore all files and folders starting with ".", except a few exceptions
.*
!.mvn/
!.gitignore
!.gitattributes
!.github/
!.default.docker.env

# Ignore generated files
target
Expand Down
19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
60 changes: 48 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,79 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- [#239](https://github.com/green-code-initiative/creedengo-rules-specifications/issues/239) Add new Java rule GCI24 : Optimize Database SQL Queries (Clause LIMIT / WHERE)

### Changed

- compatibility updates for SonarQube 25.1.0 and 25.2.0 compatibility

### Deleted

## [2.1.0] - 2025-01-07

### Added

- [#88](https://github.com/green-code-initiative/creedengo-java/pull/88) Add new Java rule GCI94 - Use orElseGet instead of orElse
- [#89](https://github.com/green-code-initiative/creedengo-java/pull/89) Add new Java rule GCI82 - Make non reassigned variables constants

### Changed

- upgrade some libraries versions
- improve Integration Tests system to be more flexible (add new IT for each rule)
- [#21](https://github.com/green-code-initiative/creedengo-java/issues/21) Improvement: some method calls are legitimate in a for loop expression
- check compatibility with SonarQube 10.7.0 and 24.12.0
- upgrade actions/upload-artifact and actions/download-artifact from v3 to v4)

## [2.0.0] - 2024-12-18

### Added

- [#59](https://github.com/green-code-initiative/creedengo-java/pull/59) Add builtin profile `ecoCode way` to aggregate all implemented ecoCode rules by this plugin
- [#53](https://github.com/green-code-initiative/creedengo-java/issues/53) Improve integration tests
- Rename rules ECXXX to the new Green Code Initiative naming convention GCIXXX
- migration from ecocode to creedengo - all over the code

### Changed

- [#49](https://github.com/green-code-initiative/creedengo-java/pull/49) Add test to ensure all Rules are registered
- [#336](https://github.com/green-code-initiative/creedengo-rules-specifications/issues/336) [Adds Maven Wrapper](https://github.com/green-code-initiative/creedengo-java/pull/67)

## [1.6.2] - 2024-07-21

### Changed

- [#60](https://github.com/green-code-initiative/ecoCode-java/issues/60) Check + update for SonarQube 10.6.0 compatibility
- [#60](https://github.com/green-code-initiative/creedengo-java/issues/60) Check + update for SonarQube 10.6.0 compatibility
- refactoring docker system
- upgrade ecocode-rules-specifications to 1.6.2

## [1.6.1] - 2024-05-15

### Changed

- [#15](https://github.com/green-code-initiative/ecoCode-java/issues/15) correction NullPointer in EC2 rule
- [#15](https://github.com/green-code-initiative/creedengo-java/issues/15) correction NullPointer in EC2 rule
- check Sonarqube 10.5.1 compatibility + update docker files and README.md

## [1.6.0] - 2024-02-02

### Added

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

### Deleted

- [#6](https://github.com/green-code-initiative/ecoCode-java/pull/6) Delete deprecated java rules EC4, EC53, EC63 and EC75
- [#6](https://github.com/green-code-initiative/creedengo-java/pull/6) Delete deprecated java rules EC4, EC53, EC63 and EC75

## [1.5.2] - 2024-01-23

### Changed

- [#9](https://github.com/green-code-initiative/ecoCode-java/issues/9) EC2 rule : correction no block statement use case
- [#9](https://github.com/green-code-initiative/creedengo-java/issues/9) EC2 rule : correction no block statement use case

## [1.5.1] - 2024-01-23

### Changed

- [#7](https://github.com/green-code-initiative/ecoCode-java/issues/7) EC2 rule : correction NullPointer with interface
- [#7](https://github.com/green-code-initiative/creedengo-java/issues/7) EC2 rule : correction NullPointer with interface

## [1.5.0] - 2024-01-06

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

- Update ecocode-rules-specifications to 1.4.6

[unreleased](https://github.com/green-code-initiative/ecoCode-java/compare/1.6.1...HEAD)
[1.6.1](https://github.com/green-code-initiative/ecoCode-java/compare/1.6.0...1.6.1)
[1.6.0](https://github.com/green-code-initiative/ecoCode-java/compare/1.5.2...1.6.0)
[1.5.2](https://github.com/green-code-initiative/ecoCode-java/compare/1.5.1...1.5.2)
[1.5.1](https://github.com/green-code-initiative/ecoCode-java/compare/1.5.0...1.5.1)
[1.5.0](https://github.com/green-code-initiative/ecoCode-java/releases/tag/1.5.0)
[unreleased](https://github.com/green-code-initiative/creedengo-java/compare/2.1.0...HEAD)
[2.1.0](https://github.com/green-code-initiative/creedengo-java/compare/2.0.0...2.1.0)
[2.0.0](https://github.com/green-code-initiative/creedengo-java/compare/1.6.2...2.0.0)
[1.6.2](https://github.com/green-code-initiative/creedengo-java/compare/1.6.1...1.6.2)
[1.6.1](https://github.com/green-code-initiative/creedengo-java/compare/1.6.0...1.6.1)
[1.6.0](https://github.com/green-code-initiative/creedengo-java/compare/1.5.2...1.6.0)
[1.5.2](https://github.com/green-code-initiative/creedengo-java/compare/1.5.1...1.5.2)
[1.5.1](https://github.com/green-code-initiative/creedengo-java/compare/1.5.0...1.5.1)
[1.5.0](https://github.com/green-code-initiative/creedengo-java/releases/tag/1.5.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.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
ARG MAVEN_BUILDER=3-openjdk-17-slim
ARG SONARQUBE_VERSION=10.6.0-community

#ARG SONARQUBE_VERSION=24.12.0.100206-community
#ARG SONARQUBE_VERSION=25.1.0.102122-community
ARG SONARQUBE_VERSION=25.2.0.102705-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-java # Root directory
creedengo-java # Root directory
|
+--src # source directory
|
Expand Down
Loading
Loading