Skip to content

A Flake8 plugin to ensure a consistent format for multiline containers.

License

Notifications You must be signed in to change notification settings

jsfehler/flake8-multiline-containers

Repository files navigation

flake8-multiline-containers

PyPI

PyPI - Python Version

GitHub

Updates

Build status

A Flake8 plugin to ensure a consistent format for multiline containers.

Installation

Install from pip with:

pip install flake8-multiline-containers

Rules

Code Rule
JS101 Multi-line container not broken after opening character
JS102 Multi-line container does not close on same column as opening

Examples

# 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'
      }

About

A Flake8 plugin to ensure a consistent format for multiline containers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages