google / google/yapf

`split_before_arithmetic_operator` is ignored?

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

Description

Despite this simple config file:

```ini
[style]
based_on_style = pep8
split_before_arithmetic_operator = true
```

yapf splits **after** the operator, not before as it should:
```diff
% ~/.local/bin/yapf --diff --style op.yapf op.py
--- op.py (original)
+++ op.py (reformatted)
@@ -1 +1,3 @@
-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + cccccccccccccccccccccccccccccccccccccccccccccc)
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +
+ cccccccccccccccccccccccccccccccccccccccccccccc)
```

> SPLIT_BEFORE_ARITHMETIC_OPERATOR
>> Set to True to prefer splitting before +, -, *, /, //, or @ rather than after.

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.