"continuation line over-indented for hanging indent" with 0.27 (multi ".format" on same line)
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
Here is a snippet of code with the way I usually indent:
```python
class MyClass():
def __str__(self):
change_str = self.FMT_TITLE.format(
property_name='{0}{1}'.format(' ' * self.sub_level,
self.property_name),
before='',
after='',
action=self.action)
```
Given the default configuration:
```
[style]
based_on_style = pep8
column_limit = 100
align_closing_bracket_with_visual_indent = true
blank_line_before_class_docstring = true
blank_line_before_module_docstring = true
blank_line_before_nested_class_or_def = true
```
0.27 will reindent like this:
```
class MyClass():
def __str__(self):
change_str = self.FMT_TITLE.format(property_name='{0}{1}'.format(
' ' * self.sub_level, self.property_name),
before='',
after='',
action=self.action)
```
that causes a flake8 error: E126 continuation line over-indented for hanging indent.
For me, the right indentation in this case is:
```python
class MyClass():
def __str__(self):
change_str = self.FMT_TITLE.format(
property_name='{0}{1}'.format(
' ' * self.sub_level, self.property_name),
before='',
after='',
action=self.action)
```
Contributor guide
Assessment
This issue has not been assessed yet.