google / google/yapf

How to avoid having the commented indented block to be re-indented by yapf?

Open
#566 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

I am on
```
import yapf
yapf.__version__
'0.21.0'
```

Have this piece of code:
```
data = [1, 2, 3, 4, 5]
# for i in data:
# print i
print("Done")

```

After running `yapf` the code looks as:

```
data = [1, 2, 3, 4, 5]
# for i in data:
# print i
print("Done")
```

I don't want my `print i` to be re-indented by `yapf` because I after I uncomment this line, I'd need manually to indent the line. Is there any setting that would force this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.