Skip to content

Commit

Permalink
Renaming to Creedengo (#38)
Browse files Browse the repository at this point in the history
* refact: renaming to Creedengo

* fix: missing files in previous commit

* fix(renaming): added deprecated annotation on renamed rules

* fix(renaming): updated plugin inception year

* fix(renaming): updated source file headers

* feat(rules): upgraded creedengo-rules-specifications.version to 2.0.0

* doc: changelog update

* refact: addressed sonar issues

* refact: addressed sonar issues

---------

Co-authored-by: Gilles Grousset <giles.grousset@insideapp.fr>
  • Loading branch information
zippy1978 and Gilles Grousset authored Jan 7, 2025
1 parent 4bd893f commit 4a9d2cf
Show file tree
Hide file tree
Showing 131 changed files with 763 additions and 1,028 deletions.
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-ios
run: mvn -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_creedengo-ios
10 changes: 5 additions & 5 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
id: export_jar_files
uses: actions/upload-artifact@v3
with:
name: ecocode-plugins
name: creedengo-plugins
path: lib
- name: Export UPLOAD_URL
id: export_upload_url
Expand All @@ -57,7 +57,7 @@ jobs:
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
name: creedengo-plugins
path: lib
- name: Upload Release Asset - iOS Plugin
id: upload-release-asset
Expand All @@ -66,6 +66,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.build.outputs.upload_url}}
asset_path: lib/ecocode-sonar-ios-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-ios-${{ github.ref_name }}.jar
asset_content_type: application/zip
asset_path: lib/creedengo-sonar-ios-plugin-${{ github.ref_name }}.jar
asset_name: creedengo-ios-${{ github.ref_name }}.jar
asset_content_type: application/zip
23 changes: 17 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,35 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]

### Added

- [#207](https://github.com/green-code-initiative/ecoCode/issues/207) Add release tag analyzis on SonarCloud
- [#23](https://github.com/green-code-initiative/ecoCode-ios/pull/23) Docker update (updated SonarQube and sonar-apple versions)
### Changed

### Deleted

## [2.0.0]

### Added

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

### Changed

- [#23](https://github.com/green-code-initiative/creedengo-ios/pull/23) Docker update (updated SonarQube and sonar-apple versions)
- [#37](https://github.com/green-code-initiative/creedengo-ios/issues/37) Renaming to Creedengo

### Deleted

## [1.1.0]

### Changed

- Extracted iOS plugin from https://github.com/green-code-initiative/ecoCode-mobile to new repository (https://github.com/green-code-initiative/ecoCode-ios)
- [#11](https://github.com/green-code-initiative/ecoCode-ios/pull/11) License and source headers update (LGPL v3 to GPL v3)
- Extracted iOS plugin from https://github.com/green-code-initiative/creedengo-mobile to new repository (https://github.com/green-code-initiative/creedengo-ios)
- [#11](https://github.com/green-code-initiative/creedengo-ios/pull/11) License and source headers update (LGPL v3 to GPL v3)

[unreleased]: https://github.com/green-code-initiative/ecoCode-ios/compare/v1.0.1...HEAD
[unreleased]: https://github.com/green-code-initiative/creedengo-ios/compare/v1.0.1...HEAD

[1.0.1]: https://github.com/green-code-initiative/ecoCode/releases/tag/v1.0.1
[1.0.1]: https://github.com/green-code-initiative/creedengo/releases/tag/v1.0.1
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The iOS plugin is split into 3 different modules:

Swift file parser is build using the [ANTLR](https://www.antlr.org/) parser generator.

The generated parser source files are located into `swift-lang/src/main/java/io/ecocode/ios/swift/antlr/generated`. Those source files should not be edited manually.
The generated parser source files are located into `swift-lang/src/main/java/org/greencodeinitiative/creedengo/ios/swift/antlr/generated`. Those source files should not be edited manually.

When necessary (in case of Swift language syntax upgrade for example), those source files should be re-generated with ANTLR.

Expand All @@ -30,14 +30,14 @@ When adding a new rule, the following steps are required:

### Declaring the rule

The new rule must be declared in `swift-lang/src/resources/ecocode_swift_profile.json`
The new rule must be declared in `swift-lang/src/resources/creedengo_swift_profile.json`

> Note: in case the new rule is not available in https://github.com/green-code-initiative/ecoCode/tree/main/ecocode-rules-specifications yet create a matching <RULE_ID>.json ans <RULE_ID>.html in `swift-lang/src/resources/io/ecocode/rules/swift/` to provide rule metadata.
> Note: in case the new rule is not available in https://github.com/green-code-initiative/creedengo/tree/main/creedengo-rules-specifications yet create a matching <RULE_ID>.json ans <RULE_ID>.html in `swift-lang/src/resources/io/creedengo/rules/swift/` to provide rule metadata.
### Implementing a check

In order to implement a check for the rule, create a Check class inherited from `SwiftRuleCheck` in `src/main/java/io/ecocode/ios/swift/checks`.
In order to implement a check for the rule, create a Check class inherited from `SwiftRuleCheck` in `src/main/java/org/greencodeinitiative/creedengo/ios/swift/checks`.

Have a look at `swift-lang/src/main/java/io/ecocode/ios/swift/checks/idleness/IdleTimerDisabledCheck` to learn more about the implementation.
Have a look at `swift-lang/src/main/java/org/greencodeinitiative/creedengo/ios/swift/checks/idleness/IdleTimerDisabledCheck` to learn more about the implementation.

Don't forget to add the `@org.sonar.check.Rule` annotation to the check in order to register it to the AST visitor.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM sonarqube:10.5.0-community
USER root
ADD https://github.com/insideapp-oss/sonar-apple/releases/download/0.4.1/sonar-apple-plugin-0.4.1.jar /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.4.1.jar
RUN chmod 777 /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.4.1.jar
ADD https://github.com/insideapp-oss/sonar-apple/releases/download/0.5.0/sonar-apple-plugin-0.5.0.jar /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.5.0.jar
RUN chmod 777 /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.5.0.jar
USER sonarqube
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
![Logo](docs/resources/5ekko.png)
======================================

Mobile apps running on top of battery-limited devices are more than others concerned by the reduction of their environmental footprint. Hence, we created `ecoCode iOS`, the version of ecoCode project fully dedicated to the iOS platform. It provides static code analyzers to highlight code structures that may have a negative ecological impact: energy over-consumption, "fatware", shortening devices' lifespan, etc.
Mobile apps running on top of battery-limited devices are more than others concerned by the reduction of their environmental footprint. Hence, we created `Creedengo iOS`, the version of Creedengo project fully dedicated to the iOS platform. It provides static code analyzers to highlight code structures that may have a negative ecological impact: energy over-consumption, "fatware", shortening devices' lifespan, etc.

ecoCode iOS is based on evolving catalogs of [best practices for iOS](https://github.com/cnumr/best-practices-mobile?#-ios-platform). A SonarQube plugin then implements these catalogs as rules for scanning your projects.
Creedengo iOS is based on evolving catalogs of [best practices for iOS](https://github.com/cnumr/best-practices-mobile?#-ios-platform). A SonarQube plugin then implements these catalogs as rules for scanning your projects.

[![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-ios/actions/workflows/build.yml/badge.svg)
[![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/creedengo-ios/actions/workflows/build.yml/badge.svg)

[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_ecoCode-ios&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_ecoCode-ios) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_ecoCode-ios&metric=coverage)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_ecoCode-ios) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_ecoCode-ios&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_ecoCode-ios) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_ecoCode-ios&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_ecoCode-ios) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_ecoCode-ios&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_ecoCode-ios)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_creedengo-ios&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_creedengo-ios) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_creedengo-ios&metric=coverage)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_creedengo-ios) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_creedengo-ios&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_creedengo-ios) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_creedengo-ios&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_creedengo-ios) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=green-code-initiative_creedengo-ios&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=green-code-initiative_creedengo-ios)

🌿 SonarQube Plugin
-------------------

ecoCode iOS SonarQube plugin is an "eco-responsibility" static code analyzer for iOS projects written in Swift. Its aim is to detect code smells indicating how the source code can be improved to reduce their environmental and social impact.
Creedengo iOS SonarQube plugin is an "eco-responsibility" static code analyzer for iOS projects written in Swift. Its aim is to detect code smells indicating how the source code can be improved to reduce their environmental and social impact.

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

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

> NB: To work, `ecocode-ios` needs `Swift` language support in SonarQube. For *SonarQube Community Edition* (which does not support Swift language), you need to install an additional plugin like [sonar-apple](https://github.com/insideapp-oss/sonar-apple).
> NB: To work, `creedengo-ios` needs `Swift` language support in SonarQube. For *SonarQube Community Edition* (which does not support Swift language), you need to install an additional plugin like [sonar-apple](https://github.com/insideapp-oss/sonar-apple).
By default ecoCode profile is not activated. To activate ecoCode rules in SonarQube, create a new profile (or extend an existing one) where ecoCode rules are activated. Here is an example:
By default Creedengo profile is not activated. To activate Creedengo rules in SonarQube, create a new profile (or extend an existing one) where Creedengo rules are activated. Here is an example:

![Profiles](docs/resources/profiles.png)

Expand Down Expand Up @@ -62,7 +62,7 @@ The tests instance of SonarQube with the plugin will then be available at: [http

### Test

An iOS test project is available [here](https://github.com/green-code-initiative/ecoCode-mobile-ios-swift-test-project)/
An iOS test project is available [here](https://github.com/green-code-initiative/creedengo-mobile-ios-swift-test-project)/

🤝 Partners
------------
Expand All @@ -85,4 +85,4 @@ An iOS test project is available [here](https://github.com/green-code-initiative

If you want to contribute to the project, your help will be greatly appreciated.

Start right away by reading [General contribution guide](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/CONTRIBUTING.md) and the [iOS specific contribution guide](https://github.com/green-code-initiative/ecoCode-ios/blob/main/CONTRIBUTING.md).
Start right away by reading [General contribution guide](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/CONTRIBUTING.md) and the [iOS specific contribution guide](https://github.com/green-code-initiative/creedengo-ios/blob/main/CONTRIBUTING.md).
8 changes: 4 additions & 4 deletions commons-ios/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.ecocode</groupId>
<artifactId>ios-plugin</artifactId>
<version>1.1.1-SNAPSHOT</version>
<groupId>org.green-code-initiative</groupId>
<artifactId>creedengo-ios-plugin</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>ecocode-commons-ios</artifactId>
<artifactId>creedengo-commons-ios</artifactId>

<dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2024 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
Expand All @@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios;
package org.greencodeinitiative.creedengo.ios;

public final class Const {
public static final String SWIFT_REPOSITORY_KEY = "ecoCode-swift";
public static final String PBXPROJ_REPOSITORY_KEY = "ecoCode-pbxproj";
public static final String SWIFT_REPOSITORY_KEY = "creedengo-swift";
public static final String PBXPROJ_REPOSITORY_KEY = "creedengo-pbxproj";

private Const() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2024 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
Expand All @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios.antlr;
package org.greencodeinitiative.creedengo.ios.antlr;

import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.Token;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2024 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
Expand All @@ -15,8 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package io.ecocode.ios.antlr;
package org.greencodeinitiative.creedengo.ios.antlr;

import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
import org.antlr.v4.runtime.tree.ParseTree;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2024 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
Expand All @@ -15,8 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package io.ecocode.ios.antlr;
package org.greencodeinitiative.creedengo.ios.antlr;

import org.sonar.api.batch.fs.FilePredicate;
import org.sonar.api.batch.fs.InputFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2024 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
Expand All @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios.antlr;
package org.greencodeinitiative.creedengo.ios.antlr;

import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.sensor.SensorContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2024 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
Expand All @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios.antlr;
package org.greencodeinitiative.creedengo.ios.antlr;

import org.antlr.v4.runtime.tree.ParseTree;
import org.sonar.api.batch.sensor.SensorContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2024 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
Expand All @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios.antlr;
package org.greencodeinitiative.creedengo.ios.antlr;

public final class SourceLine {

Expand Down
Loading

0 comments on commit 4a9d2cf

Please sign in to comment.