introduce a configure dot split penalty
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
Given this file:
```python
l = {
'foo': {
'bar':
re.compile(r'lllllllllllllllllllllllllllllllllllloooooooooooooooooooooooolllllllllllllllllllllllllllllllllllll'),
}
}
```
## Config 1
```ini
[style]
based_on_style = pep8
column_limit = 80
dedent_closing_brackets = true
```
Output is fine:
```python
l = {
'foo': {
'bar':
re.compile(
r'lllllllllllllllllllllllllllllllllllloooooooooooooooooooooooolllllllllllllllllllllllllllllllllllll'
),
}
}
```
## Config 2
```ini
[style]
based_on_style = pep8
column_limit = 120
dedent_closing_brackets = true
```
Output is uglier:
```
l = {
'foo': {
'bar':
re.
compile(r'lllllllllllllllllllllllllllllllllllloooooooooooooooooooooooolllllllllllllllllllllllllllllllllllll'),
}
}
```
The first output would have been prettier: having the string alone, rather than splitting before a dot. Maybe adding a configurable penalty for dot splitting would help? Or just output the first directly?
Contributor guide
Assessment
This issue has not been assessed yet.