yapf icon indicating copy to clipboard operation
yapf copied to clipboard

continuation_indent_width is ignored, when use_tabs is True

Open UnitedMarsupials opened this issue 2 years ago • 1 comments
trafficstars

I'm trying to follow the BSD style(9) guide even when using languages other than C. One particular aspect of that standard is that, although hierarchical indentation uses tabs, the line-continuation is done with four spaces.

Unfortunately, with use_tabs=True yapf seems to ignore the continuation_indent_width=4 -- indenting things like long function-calls with tabs too:

		p = subprocess.run(call_args,
			stderr = subprocess.PIPE,
			stdout = subprocess.PIPE,
			timeout = timeout)

instead of:

		p = subprocess.run(call_args,
		    stderr = subprocess.PIPE,
		    stdout = subprocess.PIPE,
		    timeout = timeout)

Can anything be done about this, please?

UnitedMarsupials avatar Mar 30 '23 18:03 UnitedMarsupials

The instead of block combines tabs and spaces. Line continuation should have tabs only. The current behavior is correct.

Spitfire1900 avatar Jun 16 '23 14:06 Spitfire1900