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

Remove leading whitespace for UnusedVariable suggested fixes #2524

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tnterdan
Copy link

Fixes #2500, at least for the UnusedVariable BugChecker

This PR now includes removing of up to one line of leading whitespace when suggesting a fix. This helps error-prone automated fixes look a bit more like how a developer may typically remove unused code, and avoids some of the extra unnecessary line breaks that a linter would not be able to remove.

Note to reviewers: I made sure to write the methods in such a way that behavior was only changed in places that were chosen deliberately, but please let me know if you'd prefer this to be behind a configuration option.

@google-cla google-cla bot added the cla: yes label Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature - Option to remove associated whitespace for SuggestedFix.Builder replace and delete
1 participant