Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #217 +/- ##
==========================================
+ Coverage 96.44% 96.47% +0.02%
==========================================
Files 97 98 +1
Lines 4169 4196 +27
==========================================
+ Hits 4021 4048 +27
Misses 148 148
|
50a61fb to
17d0b13
Compare
andrecsilva
approved these changes
Jan 19, 2024
|
|
||
|
|
||
|
|
Contributor
There was a problem hiding this comment.
I feel those empty lines shouldn't be here.
drdavella
requested changes
Jan 22, 2024
Member
drdavella
left a comment
There was a problem hiding this comment.
Very nice overall but some suggestions for metadata
| class FixAssertTuple(SimpleCodemod, NameResolutionMixin): | ||
| metadata = Metadata( | ||
| name="fix-assert-tuple", | ||
| summary="Fix Assert on Populated Tuple", |
Member
There was a problem hiding this comment.
Suggestion:
Suggested change
| summary="Fix Assert on Populated Tuple", | |
| summary="Fix `assert` on Non-Empty Tuple Literal", |
| references=[], | ||
| ) | ||
| change_description = ( | ||
| "Separate assertion on a populated tuple into multiple assert statements." |
Member
There was a problem hiding this comment.
Suggested change
| "Separate assertion on a populated tuple into multiple assert statements." | |
| "Separate assertion on a non-empty tuple literal into multiple assert statements." |
| @@ -0,0 +1,11 @@ | |||
| An assertion on a non-empty tuple will always evaluate to `True` so it's likely to be written unintentionally. This codemod will write one assert statement for each item in the tuple. | |||
Member
There was a problem hiding this comment.
Suggested change
| An assertion on a non-empty tuple will always evaluate to `True` so it's likely to be written unintentionally. This codemod will write one assert statement for each item in the tuple. | |
| An assertion on a non-empty tuple will always evaluate to `True`. This means that `assert` statements involving non-empty tuple literals are likely unintentional and should be rewritten. This codemod rewrites the original `assert` statement by creating a new `assert` for each item in the original tuple. |
| metadata = Metadata( | ||
| name="fix-assert-tuple", | ||
| summary="Fix Assert on Populated Tuple", | ||
| review_guidance=ReviewGuidance.MERGE_WITHOUT_REVIEW, |
Member
There was a problem hiding this comment.
I think this should be MERGE_AFTER_CURSORY_REVIEW because there's a decent change we break some tests.
17d0b13 to
5953722
Compare
|
drdavella
approved these changes
Jan 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview
Codemod to convert
assert (1, 2)intoNotice the same sonarcloud rule this PR triggered and this is the same pylint rule