Skip to content

Commit 24ed832

Browse files
committed
fixup! fix: fix tab-space mix with tab indenation and continuation_align_style=SPACE
1 parent 03e8d14 commit 24ed832

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

yapf/yapflib/format_token.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _TabbedContinuationAlignPadding(spaces, align_style, tab_width):
7777
if spaces > 0:
7878
return '\t' * int((spaces + tab_width - 1) / tab_width)
7979
return ''
80-
if spaces % tab_width == 0:
80+
if tab_width > 1 and spaces % tab_width == 0:
8181
return '\t' * (spaces // tab_width)
8282
return ' ' * spaces # TODO: add a comment why we indent with spaces in a tab area?
8383

yapftests/yapf_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1268,8 +1268,8 @@ def f():
12681268
expected_formatted_code = """\
12691269
def f():
12701270
return [
1271-
'hello',
1272-
'world',
1271+
'hello',
1272+
'world',
12731273
]
12741274
"""
12751275
style_contents = u"""\

0 commit comments

Comments
 (0)