-
Notifications
You must be signed in to change notification settings - Fork 892
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
Trailing whitespace changes are made outside of --lines #613
Comments
I also ran into this issue. |
It appears to be a problem in the def Visit_suite(self, node): # pylint: disable=invalid-name
# A 'suite' starts a new indentation level in Python.
self._cur_depth += 1
self._StartNewLine()
self.DefaultNodeVisit(node)
self._cur_depth -= 1 Here, |
This is still an issue and it is preventing me from using yapf on my projects. |
@SkyeNygaard @braineo @dmytrokyrychuk I've created a fork (PR 1102) that fixes this bug, but it needs extensive testing as making this right is quite difficult. It still wouldn't fix the test case in the initial post, as the whitespace before line 4 will be changed, but at least majority of the issue is fixed. For convenience, here's the patch: yapf_restrict_lines.diff.txt |
Description
Trailing whitespace is removed from the whole file when attempting to format a subset of a file.
Steps to reproduce
pip install yapf==0.23
Run the following script:
Expected output
Actual output
The text was updated successfully, but these errors were encountered: