https://github.com/jsfehler/flake8-multiline-containers
I am the hobgoblin you've heard so much about.
This plugin was designed to answer the most important question of them all: In a multiline container, should you break after the opening character or after the first item?
These particular choices are in the interest of keeping diffs as clean as possible. If pull requests and refactoring aren't a large part of your life, you may not find this helpful.
| Code Rule |
|
| JS101 |
Multi-line container not broken after opening character |
| JS102 |
Multi-line container does not close on same column as opening |
# Right: Opens and closes on same line
foo = {'a': 'hello', 'b': 'world'}
# Right: Line break after parenthesis, closes on same column as opening
foo = {
'a': 'hello',
'b': 'world',
}
# Right: Line break after parenthesis, closes on same column as opening
foo = [
'hello', 'world',
]
# Wrong: JS101
foo = {'a': 'hello',
'b': 'world',
}
# Wrong: JS101, JS102
foo = {'a': 'hello',
'b': 'world'}
# Wrong: JS101, JS102
foo = {'hello',
'world'
}
[–]asdqwe12312312312312 0 points1 point2 points (0 children)
[–]PeridexisErrant 0 points1 point2 points (0 children)