supplemental: Add violation message in unusedLocalVariable input files#15189
Merged
Conversation
romani
requested changes
Jul 2, 2024
| int ab = 12; | ||
| ab += a; | ||
| int var1 = 1; // violation | ||
| int var1 = 1; // violation, 'Unused local variable*.' |
Member
There was a problem hiding this comment.
// violation, 'Unused local variable'
Or put name of variable name to message, but if case is simple, no need
Member
Author
There was a problem hiding this comment.
done. I didn't add the variable name because each file will require manual updates. I did it using the "replace All" option in Intelliji.
I just realized that we can close "remove unnecessary ok" issue with one click. I don't know what prevents us from doing this in a single PR :)
Member
There was a problem hiding this comment.
Yes, it is easy, but somebody needs to do this.
And there nuances.
romani
requested changes
Jul 2, 2024
| String foo = "", hoo = ""; | ||
| String hoo2 = ""; // violation, 'Unused local variable' | ||
| String hoo3 = ""; // violation, 'Unused local variable' | ||
| // violation below, 'Unused local variable*.' |
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.
We will introduce a new message in #15187. So we need to update all existing files to specify the message. Specifying the message is obligatory when we have more than one.