-
Notifications
You must be signed in to change notification settings - Fork 22
GCI99 OptimizeSquareComputation #Python #DLG #Build #72
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
Conversation
Co-authored-by: DataLabGroupe-CreditAgricole <GITHUB.DATALABGROUPE@CREDIT-AGRICOLE-SA.FR>
Co-authored-by: DataLabGroupe-CreditAgricole <GITHUB.DATALABGROUPE@CREDIT-AGRICOLE-SA.FR>
|
This PR has been automatically marked as stale because it has no activity for 30 days. |
…ations version and rename rule GCI99 to GCI97 Co-authored-by: DataLabGroupe-CreditAgricole <GITHUB.DATALABGROUPE@CREDIT-AGRICOLE-SA.FR>
There was a problem hiding this 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 Python rule (GCI99) to detect and flag inefficient square computations (x**2 and math.pow(x, 2)) and suggests using x*x instead. Key changes include:
- Implementation of the
OptimizeSquareComputationrule in Java. - Addition of Python test cases and a JUnit test.
- Registration of the new rule, bumping of the spec version, and changelog update.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/resources/checks/optimizeSquareComputation.py | Adds sample Python cases marked noncompliant for square ops. |
| src/test/java/org/greencodeinitiative/creedengo/python/checks/OptimizeSquareComputationTest.java | Adds a JUnit test invoking the new rule. |
| src/main/java/org/greencodeinitiative/creedengo/python/checks/OptimizeSquareComputation.java | Implements the logic to flag **2 and math.pow(..., 2). |
| src/main/java/org/greencodeinitiative/creedengo/python/PythonRuleRepository.java | Registers the new rule in the repository. |
| pom.xml | Bumps creedengo-rules-specifications to 2.3.0. |
| CHANGELOG.md | Documents addition of rule GCI99. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an integration test like explained in another PR : #71 (review)
Co-authored-by: DataLabGroupe-CreditAgricole <GITHUB.DATALABGROUPE@CREDIT-AGRICOLE-SA.FR>
Co-authored-by: DataLabGroupe-CreditAgricole <GITHUB.DATALABGROUPE@CREDIT-AGRICOLE-SA.FR>
Verified that the rule does not exist.
Confirmed that the rule is not listed in Rules.MD, so a new ID GCI99 was created.
Added a corresponding Python unit test.
Updated the CHANGELOG accordingly.