Skip to content

Commit 9da3676

Browse files
authored
Merge branch 'main' into AvoidCreatingTensorUsingNumpyOrNativePython
2 parents aa6cb6a + 6ed7a17 commit 9da3676

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1248
-255
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ on:
55
branches:
66
- main
77
paths-ignore:
8-
- '*.md'
9-
- '.github/**/*.yml'
8+
- "*.md"
9+
- ".github/**/*.yml"
1010
tags:
11-
- '[0-9]+.[0-9]+.[0-9]+'
11+
- "[0-9]+.[0-9]+.[0-9]+"
1212
pull_request:
13-
types: [ opened, synchronize, reopened ]
13+
types: [opened, synchronize, reopened]
14+
workflow_dispatch:
1415

1516
jobs:
1617
build:
@@ -22,12 +23,12 @@ jobs:
2223
- name: Checkout
2324
uses: actions/checkout@v4
2425
with:
25-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
26+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2627

2728
- name: Set up JDK 11
2829
uses: actions/setup-java@v4
2930
with:
30-
distribution: 'temurin'
31+
distribution: "temurin"
3132
java-version: 11
3233

3334
- name: Cache SonarQube packages
@@ -44,8 +45,12 @@ jobs:
4445
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4546
restore-keys: ${{ runner.os }}-m2
4647

47-
- name: Build and analyze
48+
- name: Build
49+
run: mvn -B verify
50+
51+
- name: Sonar Scan
52+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
4853
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
5055
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
51-
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
56+
run: mvn -B initialize org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

CHANGELOG.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Added rule GCI104 on Torch Tensor types
12+
- [#388](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/388) Added rule GCI104 on Torch Tensor types
13+
- [#387](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/387) Add rule GCI103, add specifications for a new rule on iteration method for dict in Python
14+
- [#386](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/386) Add rule GCI102, recommending the use of pinned memory for the dataloader when transferring data from the CPU to the GPU.
15+
- [#385](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/385) Add rule GCI101, Added documentation for the rule : disables bias in convolutional layers preceding Batch Normalization.
16+
- [#384](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/384) Add specifications for rule GCI100, this rule is specific to Python because it's based on the `PyTorch` library, a library used for Deep Learning.
17+
- [#379](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/379) Add rule GCI99 Avoid CSV Format, this rule is designed for Python but it can be implemented in other languages. The rule suggests using more efficient formats like Feather or Parquet instead of CSV.
18+
- [#401](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/401) Add rule GCI98 for Java. Don't catch RuntimeException. They represent a problem in the program that should be fixed, not handled
1319

1420
### Changed
1521

16-
- Correction of various typos in rules documentations
22+
### Deleted
23+
24+
## [2.3.0] - 2025-07-08
25+
26+
### Added
27+
28+
- [#400](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/400) Add rule GCI535 - Prefer usage of Intl.NumberFormat
29+
- [#382](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/382) Add specifications for rule GCI96, this rule is specific to Python because it's based on the `pandas` library, a library used for data.
30+
- [#383](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/383) Add specifications for rule GCI97, this rule concerns the different ways of squaring a value.
1731

1832
### Deleted
1933

34+
- [#58](https://github.com/green-code-initiative/creedengo-php/issues/58) Deprecation of GCI66 rule for PHP
35+
- deletion of deprecated PHP GCI34 rule
36+
37+
## [2.2.3] - 2025-05-25
38+
39+
### Added
40+
41+
- [#322](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/332) [GCI95] Avoid querying SQL columns that are not used
42+
43+
### Changed
44+
45+
- [GCI91](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/410) Adapt rule GCI91 to java context in case of stream
46+
- [GCI69](https://github.com/green-code-initiative/creedengo-rules-specifications/pull/396) Calls to hasMoreElements() and nextElement() methods from java.util.Enumeration interface aren't flagged anymore when called in a for loop
47+
- Correction of various typos in rules documentations
48+
- [#44](https://github.com/green-code-initiative/creedengo-java/issues/44) Improvement: "++i" statement is not so bad
49+
2050
## [2.2.2] - 2025-03-13
2151

2252
### Added
@@ -405,7 +435,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
405435

406436
## Comparison List
407437

408-
[unreleased](https://github.com/green-code-initiative/creedengo-rules-specifications/compare/2.2.1...HEAD)
438+
[unreleased](https://github.com/green-code-initiative/creedengo-rules-specifications/compare/2.2.3...HEAD)
439+
[2.2.3](https://github.com/green-code-initiative/creedengo-rules-specifications/compare/2.2.2...2.2.3)
440+
[2.2.2](https://github.com/green-code-initiative/creedengo-rules-specifications/compare/2.2.1...2.2.2)
409441
[2.2.1](https://github.com/green-code-initiative/creedengo-rules-specifications/compare/2.2.0...2.2.1)
410442
[2.2.0](https://github.com/green-code-initiative/creedengo-rules-specifications/compare/2.1.0...2.2.0)
411443
[2.1.0](https://github.com/green-code-initiative/creedengo-rules-specifications/compare/2.0.0...2.1.0)

README.md

Lines changed: 68 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
![Logo](docs/resources/creedengo_logo.png)
2-
======================================
1+
<div align="center">
2+
<picture>
3+
<source media="(prefers-color-scheme: dark)" width="500" height="100" srcset="docs/resources/creedengo_light.svg">
4+
<source media="(prefers-color-scheme: light)" width="500" height="100" srcset="docs/resources/creedengo_dark.svg">
5+
<img alt="Creedengo logo" width="500" height="100" src="docs/resources/creedengo_light.svg">
6+
</picture>
7+
<p>
8+
<strong>A Green Code Initiative project</strong>
9+
</p>
10+
</div>
11+
12+
---
313

414
_creedengo_ is a collective project aiming to reduce environmental footprint of software at the code level. The goal of
515
the project is to provide a list of static code analyzers to highlight code structures that may have a negative
@@ -14,22 +24,21 @@ refer to the contribution section.
1424
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
1525
[![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)
1626

17-
🌿 SonarQube Plugins
18-
-------------------
27+
## 🌿 SonarQube Plugins
1928

2029
7 technologies are supported by creedengo right now:
2130

2231
- "standard" plugins :
23-
- [Java plugin](https://github.com/green-code-initiative/creedengo-java)
24-
- [JavaScript plugin](https://github.com/green-code-initiative/creedengo-javascript)
25-
- [PHP plugin](https://github.com/green-code-initiative/creedengo-php)
26-
- [Python plugin](https://github.com/green-code-initiative/creedengo-python)
27-
- [C# plugin](https://github.com/green-code-initiative/creedengo-csharp)
32+
- [Java plugin](https://github.com/green-code-initiative/creedengo-java)
33+
- [JavaScript plugin](https://github.com/green-code-initiative/creedengo-javascript)
34+
- [PHP plugin](https://github.com/green-code-initiative/creedengo-php)
35+
- [Python plugin](https://github.com/green-code-initiative/creedengo-python)
36+
- [C# plugin](https://github.com/green-code-initiative/creedengo-csharp)
2837
- mobile plugins :
29-
- [Android plugin](https://github.com/green-code-initiative/creedengo-android)
30-
- [iOS plugin](https://github.com/green-code-initiative/creedengo-ios)
38+
- [Android plugin](https://github.com/green-code-initiative/ecoCode-android)
39+
- [iOS plugin](https://github.com/green-code-initiative/creedengo-ios)
3140

32-
![Screenshot](docs/resources/screenshot.PNG)
41+
![Screenshot](docs/resources/screenshot.jpg)
3342

3443
### eco-design SonarQube plugin
3544

@@ -42,9 +51,9 @@ There are two kinds of plugins :
4251
You can find all the
4352
rules [here (in french)](https://docs.google.com/spreadsheets/d/1nujR4EnajnR0NSXjvBW3GytOopDyTfvl3eTk2XGLh5Y/edit#gid=1386834576).
4453
The current repository is for web / backOffice
45-
- One for mobile (Android), using [a set of smells](https://olegoaer.perso.univ-pau.fr/android-energy-smells/) theorised
46-
by Olivier Le Goaër for Android.
47-
You can find this plugin in the repository [here](https://github.com/green-code-initiative/creedengo-mobile)
54+
- One for mobile (Android/iOS), using [a set of code smells](https://github.com/cnumr/best-practices-mobile) theorised
55+
by Dr. Olivier Le Goaër.
56+
You can find this plugin in the repository [here](https://github.com/green-code-initiative/ecoCode-android)
4857

4958
### How a SonarQube plugin works
5059

@@ -96,74 +105,60 @@ in order to allow the inclusion of other pages (this feature is not available in
96105

97106
See:
98107

99-
* [AsciiDoc Syntax Quick Reference](https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/)
100-
* [Compare AsciiDoc to Markdown](https://docs.asciidoctor.org/asciidoc/latest/asciidoc-vs-markdown/)
108+
- [AsciiDoc Syntax Quick Reference](https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/)
109+
- [Compare AsciiDoc to Markdown](https://docs.asciidoctor.org/asciidoc/latest/asciidoc-vs-markdown/)
101110

111+
## 🚀 Getting Started
102112

103-
🚀 Getting Started
104-
------------------
105-
106-
You can quickly have a look of creedengo plugins with docker. Plase have a look at "Getting started" section of each plugin :
113+
You can quickly explore Creedengo plugins using Docker. Refer to the "Getting Started" section of each plugin for
114+
detailed instructions:
107115

108116
- [Java plugin](https://github.com/green-code-initiative/creedengo-java?tab=readme-ov-file#-getting-started)
109117
- [PHP plugin](https://github.com/green-code-initiative/creedengo-php?tab=readme-ov-file#-getting-started)
110118
- [Python plugin](https://github.com/green-code-initiative/creedengo-python?tab=readme-ov-file#-getting-started)
111119
- [C# plugin](https://github.com/green-code-initiative/creedengo-csharp?tab=readme-ov-file#-getting-started)
120+
- [Android Java plugin](https://github.com/green-code-initiative/ecoCode-android?tab=readme-ov-file#-quickstart)
112121

113-
🛒 Distribution
114-
------------------
122+
## 🛒 Distribution
115123

116-
The main way to get creedengo plugins is to download them from your SonarQube Marketplace (available in Administration section).
117-
But if you want, you can also download them from GitHub releases.
124+
The primary way to obtain Creedengo plugins is through the SonarQube Marketplace, accessible in the Administration
125+
section. Alternatively, you can download them directly from the GitHub releases.
118126

119127
We had split our plugins repository `creedengo` to one repository for each plugin on december 2023.
120128
Thus, plugin versions are available on 2 repositories depending on version you want :
121129

122130
- Java plugin :
123-
- from 0.x to 1.4.3 : [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications/releases)
124-
- since 1.5.0 : [creedengo-java repository](https://github.com/green-code-initiative/creedengo-java/releases)
131+
- from 0.x to
132+
1.4.3 : [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications/releases)
133+
- since 1.5.0 : [creedengo-java repository](https://github.com/green-code-initiative/creedengo-java/releases)
125134
- PHP plugin :
126-
- from 0.x to 1.3.1 : [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications/releases)
127-
- since 1.4.0 : [creedengo-php repository](https://github.com/green-code-initiative/creedengo-php/releases)
135+
- from 0.x to
136+
1.3.1 : [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications/releases)
137+
- since 1.4.0 : [creedengo-php repository](https://github.com/green-code-initiative/creedengo-php/releases)
128138
- Python plugin :
129-
- from 0.x to 1.3.1 : [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications/releases)
130-
- since 1.4.0 : [creedengo-python repository](https://github.com/green-code-initiative/creedengo-python/releases)
139+
- from 0.x to
140+
1.3.1 : [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications/releases)
141+
- since 1.4.0 : [creedengo-python repository](https://github.com/green-code-initiative/creedengo-python/releases)
131142
- Javascript plugin :
132-
- from 0.x to 1.3.0 : [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications/releases)
133-
- since 1.4.0 : [creedengo-javascript repository](https://github.com/green-code-initiative/creedengo-javascript/releases)
143+
- from 0.x to
144+
1.3.0 : [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications/releases)
145+
- since
146+
1.4.0 : [creedengo-javascript repository](https://github.com/green-code-initiative/creedengo-javascript/releases)
134147
- C# plugin :
135-
- since 0.x : [creedengo repository](https://github.com/green-code-initiative/creedengo-csharp/releases)
136-
- Android plugin : [creedengo-android repository](https://github.com/green-code-initiative/creedengo-android/releases)
148+
- since 0.x : [creedengo repository](https://github.com/green-code-initiative/creedengo-csharp/releases)
149+
- Android plugin : [creedengo-android repository](https://github.com/green-code-initiative/ecoCode-android/releases)
137150
- iOS plugin : [creedengo-ios repository](https://github.com/green-code-initiative/creedengo-ios/releases)
138151

139-
🧩 Plugins version compatibility (OLD `ecocode` plugin)
140-
------------------
141-
142-
| Plugins Version | SonarQube version |
143-
|------------------|-----------------------------|
144-
| 1.4.+ | SonarQube 9.4.+ LTS to 10.1 |
145-
| 1.3.+ | SonarQube 9.4.+ LTS to 10.0 |
146-
| 1.2.+ | SonarQube 9.4.+ LTS to 10.0 |
147-
| 1.1.+ | SonarQube 9.4.+ LTS to 9.9 |
148-
| 1.0.+ | SonarQube 9.4.+ LTS to 9.9 |
149-
| 0.2.+ | SonarQube 9.4.+ LTS to 9.9 |
150-
| 0.1.+ | SonarQube 8.9.+ LTS to 9.3 |
151-
152-
☕ Plugin Java part compatibility (OLD `ecocode` plugin)
153-
------------------
154-
155-
| Plugins Version | Java version |
156-
|------------------|--------------|
157-
| 1.4.+ | 11 / 17 |
158-
| 1.3.+ | 11 / 17 |
159-
| 1.2.+ | 11 / 17 |
160-
| 1.1.+ | 11 / 17 |
161-
| 1.0.+ | 11 / 17 |
162-
| 0.2.+ | 11 / 17 |
163-
| 0.1.+ | 11 / 17 |
164-
165-
🤝 Contribution
166-
---------------
152+
## 🧩 Plugins version compatibility (OLD `ecocode` plugin)
153+
154+
| Plugins Version | SonarQube version | Java version |
155+
|---------------------|-----------------------------|--------------|
156+
| 1.4+ | SonarQube 9.4.+ LTS to 10.1 | 11 / 17 |
157+
| 1.2.x, 1.3.x | SonarQube 9.4.+ LTS to 10.0 | 11 / 17 |
158+
| 0.2.x, 1.0.x, 1.1.x | SonarQube 9.4.+ LTS to 9.9 | 11 / 17 |
159+
| 0.1.x | SonarQube 8.9.+ LTS to 9.3 | 11 / 17 |
160+
161+
## 🤝 Contribution
167162

168163
You are a technical expert, a designer, a project manager, a CSR expert, an ecodesign expert...
169164

@@ -175,10 +170,9 @@ We are listening to you to make the project progress collectively, and maybe wit
175170

176171
WE NEED YOU !
177172

178-
Here the [Starter pack](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/starter-pack.md)
173+
Here is the [Starter pack](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/starter-pack.md)
179174

180-
🤓 Main contributors
181-
--------------------
175+
## 🤓 Main contributors
182176

183177
Any question ? We are here for you !
184178
first, create an issue, please.
@@ -189,19 +183,18 @@ Then, if no answer, contact ...
189183
- [Julien Hertout](https://www.linkedin.com/in/julien-hertout-b1175449/)
190184
- [Justin Berque](https://www.linkedin.com/in/justin-berque-444412140)
191185
- [Olivier Le Goaër](https://olegoaer.perso.univ-pau.fr)
192-
- [Maxime DUBOIS](https://www.linkedin.com/in/maxime-dubois-%F0%9F%8C%B1-649a3a3/)
193-
- [David DE CARVALHO](https://www.linkedin.com/in/david%E2%80%8E-de-carvalho-8b395284/)
194-
- [Maxime MALGORN](https://www.linkedin.com/in/maximemalgorn/)
195-
- [Gilles GROUSSET](https://www.linkedin.com/in/gillesgrousset/)
196-
- [Vianney DE BELLABRE](https://www.linkedin.com/in/vianney-de-bellabre/)
197-
- [Jérôme CARDON](https://www.linkedin.com/in/jcardon79/)
198-
- [Johanna DUIGOU](https://www.linkedin.com/in/johannaduigou/)
186+
- [David De Carvalho](https://www.linkedin.com/in/david%E2%80%8E-de-carvalho-8b395284/)
187+
- [Maxime Malgorn](https://www.linkedin.com/in/maximemalgorn/)
188+
- [Gilles Grousset](https://www.linkedin.com/in/gillesgrousset/)
189+
- [Vianney De Bellabre](https://www.linkedin.com/in/vianney-de-bellabre/)
190+
- [Jérôme Cardon](https://www.linkedin.com/in/jcardon79/)
191+
- [Johanna Duigou](https://www.linkedin.com/in/johannaduigou/)
199192

200-
🧐 Core Team Emeriti
201-
--------------------
193+
## 🧐 Core Team Emeriti
202194

203195
Here we honor some no-longer-active core team members who have made valuable contributions in the past.
204196

197+
- [Maxime Dubois](https://www.linkedin.com/in/maxime-dubois-%F0%9F%8C%B1-649a3a3/)
205198
- Gaël Pellevoizin
206199
- [Nicolas Daviet](https://github.com/NicolasDaviet)
207200
- [Mathilde Grapin](https://github.com/fkotd)
@@ -219,8 +212,3 @@ They have contributed to the success of creedengo :
219212
They supported the project :
220213

221214
- [Région Nouvelle-Aquitaine](https://www.nouvelle-aquitaine.fr/)
222-
223-
Links
224-
-----
225-
226-
- https://docs.sonarqube.org/latest/analysis/overview/

0 commit comments

Comments
 (0)