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

[ISSUE 142] new python rule : AvoidMultipleIfElseStatement #1

Merged
merged 9 commits into from
Aug 8, 2023
Merged
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: 3 additions & 3 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ecocode-plugins
path: lib
path: target
- name: Export UPLOAD_URL
id: export_upload_url
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_OUTPUT
Expand All @@ -58,14 +58,14 @@ jobs:
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
path: lib
path: target
- 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_path: target/ecocode-python-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-python-plugin-${{ github.ref_name }}.jar
asset_content_type: application/zip
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Python rules moved from `ecoCode` repository to current repository
- [#142](https://github.com/green-code-initiative/ecoCode/issues/142) new Python rule : Multiple if-else statement + refactoring implementation
- [#205](https://github.com/green-code-initiative/ecoCode/issues/205) compatibility with SonarQube 10.1

### Changed

### Deleted

## [0.0.0]

### Added

### Changed

### Deleted

[unreleased]: https://github.com/green-code-initiative/ecoCode-python/compare/v0.0.1...HEAD
[0.0.1]: https://github.com/green-code-initiative/ecoCode-python/compare/v0.0.0...0.0.1
25 changes: 20 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:https://github.com/green-code-initiative/ecocode-python</connection>
<developerConnection>scm:git:https://github.com/green-code-initiative/ecocode-python</developerConnection>
<url>https://github.com/green-code-initiative/ecocode-python</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/green-code-initiative/ecoCode-python/issues</url>
Expand All @@ -40,19 +46,19 @@
<sonar.organization>green-code-initiative</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<!-- max version with SonarQube 10.0 -->
<sonarqube.version>9.4.0.54424</sonarqube.version>
<sonarjava.version>7.19.0.31550</sonarjava.version>
<sonarpython.version>4.3.0.11660</sonarpython.version>

<!-- max version with SonarQube 10.0 : check lib/extension directory -->
<sonarpython.version>4.1.0.11333</sonarpython.version>

<sonar-packaging.version>1.21.0.505</sonar-packaging.version>
<sonar.skipDependenciesPackaging>true</sonar.skipDependenciesPackaging>

<junit.jupiter.version>5.9.1</junit.jupiter.version>
<assertJ.version>3.23.1</assertJ.version>
<mockito.version>5.3.1</mockito.version>

<!-- temporary version waiting for real automatic release in ecocode repository -->
<ecocode-rules-specifications.version>0.0.2</ecocode-rules-specifications.version>
<ecocode-rules-specifications.version>0.0.3</ecocode-rules-specifications.version>

<sonar-analyzer-commons.version>2.5.0.1358</sonar-analyzer-commons.version>

Expand Down Expand Up @@ -81,6 +87,14 @@
<scope>provided</scope>
</dependency>

<!-- To keep because of dependency used at runtime (or else error at starting SonarQube) -->
<dependency>
<groupId>org.sonarsource.analyzer-commons</groupId>
<artifactId>sonar-analyzer-commons</artifactId>
<version>${sonar-analyzer-commons.version}</version>
</dependency>

<!-- TEST sources dependencies -->
<dependency>
<groupId>org.sonarsource.python</groupId>
<artifactId>python-checks-testkit</artifactId>
Expand Down Expand Up @@ -173,6 +187,7 @@
<jreMinVersion>${java.version}</jreMinVersion>
</configuration>
</plugin>
<!-- To keep because of dependency sonar-analyzer-commons -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public List<Class> checkClasses() {
NoFunctionCallWhenDeclaringForLoop.class,
AvoidFullSQLRequest.class,
AvoidListComprehensionInIterations.class,
DetectUnoptimizedImageFormat.class
DetectUnoptimizedImageFormat.class,
AvoidMultipleIfElseStatementCheck.class
);
}
}
Loading