Skip to content

Implement new rule GCI99#184

Open
rroot47 wants to merge 2 commits into
green-code-initiative:mainfrom
rroot47:feat/GCI99
Open

Implement new rule GCI99#184
rroot47 wants to merge 2 commits into
green-code-initiative:mainfrom
rroot47:feat/GCI99

Conversation

@rroot47
Copy link
Copy Markdown
Contributor

@rroot47 rroot47 commented May 19, 2026

No description provided.

Copy link
Copy Markdown

@rducasse rducasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Java rule GCI99 to detect usage of common CSV libraries (via imports) and recommend using columnar formats like Parquet, and wires it into the plugin’s rule set, quality profile, and tests.

Changes:

  • Added the GCI99 rule implementation (AvoidCSVFormat) and registered it in JavaCheckRegistrar.
  • Added rule metadata documentation/resources (GCI99.json, GCI99.html) and enabled the rule in creedengo_way_profile.json.
  • Added unit + integration test coverage for the new rule (JUnit CheckVerifier + GCIRulesIT + IT test-project sources).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/org/greencodeinitiative/creedengo/java/checks/AvoidCSVFormat.java Implements the GCI99 rule by flagging imports from known CSV libraries.
src/main/java/org/greencodeinitiative/creedengo/java/JavaCheckRegistrar.java Registers the new check so it is executed during analysis.
src/main/resources/org/greencodeinitiative/creedengo/java/creedengo_way_profile.json Adds GCI99 to the “creedengo way” quality profile.
src/main/resources/org/green-code-initiative/rules/java/GCI99.json Adds rule metadata (severity/type/tags/remediation).
src/main/resources/org/green-code-initiative/rules/java/GCI99.html Adds end-user rule documentation with examples.
src/test/java/org/greencodeinitiative/creedengo/java/checks/GCI99/AvoidCSVFormatTest.java Adds unit tests validating issues/no-issues for the rule.
src/it/test-projects/creedengo-java-plugin-test-project/src/main/java/org/greencodeinitiative/creedengo/java/checks/GCI99/AvoidCSVFormat.java Adds an IT test-project source containing noncompliant imports.
src/it/test-projects/creedengo-java-plugin-test-project/src/main/java/org/greencodeinitiative/creedengo/java/checks/GCI99/AvoidCSVFormatNoIssue.java Adds an IT test-project source intended to be compliant.
src/it/java/org/greencodeinitiative/creedengo/java/integration/tests/GCIRulesIT.java Adds integration tests asserting expected issues for GCI99.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/org/greencodeinitiative/creedengo/java/checks/AvoidCSVFormat.java Outdated
Comment thread src/main/resources/org/green-code-initiative/rules/java/GCI99.html Outdated
@rroot47 rroot47 force-pushed the feat/GCI99 branch 2 times, most recently from 80682b5 to e2505d6 Compare May 20, 2026 09:20
Copy link
Copy Markdown

@rducasse rducasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only 3 of the 6 entries declared in CSV_PACKAGES are tested. Please add noncompliant entries for:

  • import com.fasterxml.jackson.dataformat.csv.CsvMapper;
  • import org.supercsv.io.CsvBeanWriter;
  • import net.sf.flatpack.DataSet;

Also update GCIRulesIT.testGCI99() startLines/endLines accordingly.

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md Outdated
@rroot47 rroot47 force-pushed the feat/GCI99 branch 2 times, most recently from 8277f1a to 81b7c7d Compare May 20, 2026 12:57
@rducasse rducasse requested a review from utarwyn May 20, 2026 13:58
@rducasse rducasse self-assigned this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants