google / google/yapf

yapf: disable converts tabs to spaces (even if use_tabs: true)

Open
#522 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

Using `yapf 0.20.1` (Win10 x64)

Arguments:
```
--style {based_on_style: pep8, indent_width: 1, use_tabs: true, column_limit: 1000000, blank_line_before_nested_class_or_def: false, spaces_before_comment: 1}
```

Input (and expected output):
(note that GitHub has a tab spacing of 8 chars, so it looks weird here, but rendered with 4 chars it looks aligned)

```py
# yapf: disable
test = [1, 2, 3, 4,
5, 6, 7, 8,
9, 10, 11, 12]
# yapf: enable
```
Actual output:
```py
# yapf: disable
test = [1, 2, 3, 4,
5, 6, 7, 8,
9, 10, 11, 12]
# yapf: enable
```

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.