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

New way to define a SonarCodemod and filter_by_result behavior change #226

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

andrecsilva
Copy link
Contributor

Description

  • filter_by_result and node_is_selected will now be vacuously true if the detector is None
  • Added new way to define SonarCodemod from a given CoreCodemod
  • Refactored sonar_numpy_nan_equality and numpy_nan_equality

Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@andrecsilva andrecsilva marked this pull request as ready for review January 29, 2024 13:28
Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (615de27) 96.53% compared to head (6ff560c) 96.55%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
+ Coverage   96.53%   96.55%   +0.02%     
==========================================
  Files         101      101              
  Lines        4304     4301       -3     
==========================================
- Hits         4155     4153       -2     
+ Misses        149      148       -1     
Files Coverage Δ
src/codemodder/codemods/base_codemod.py 97.93% <100.00%> (+0.04%) ⬆️
src/codemodder/codemods/base_transformer.py 100.00% <ø> (ø)
src/codemodder/codemods/base_visitor.py 100.00% <100.00%> (ø)
src/codemodder/codemods/libcst_transformer.py 99.25% <ø> (ø)
src/codemodder/codemods/sonar.py 100.00% <100.00%> (ø)
src/codemodder/file_context.py 100.00% <100.00%> (ø)
src/core_codemods/numpy_nan_equality.py 100.00% <100.00%> (ø)
...rc/core_codemods/sonar/sonar_numpy_nan_equality.py 100.00% <100.00%> (+7.14%) ⬆️

Copy link
Member

@drdavella drdavella left a comment

Choose a reason for hiding this comment

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

Perfect, thank you.

rules: list[str],
transformer: BaseTransformerPipeline | None = None,
new_references: list[Reference] | None = None,
): # pylint: disable=too-many-arguments
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR but I think we should just reconfigure or disable this pylint rule globally.

@andrecsilva andrecsilva added this pull request to the merge queue Jan 29, 2024
Merged via the queue into main with commit ad29a81 Jan 29, 2024
14 checks passed
@andrecsilva andrecsilva deleted the detector_and_sonar branch January 29, 2024 17:42
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