Format code with black

This commit is contained in:
Oskar Hahn 2019-01-06 16:15:56 +01:00
parent 405ddaec60
commit 800055a5ea
4 changed files with 10 additions and 6 deletions

View File

@ -16,8 +16,6 @@ matrix:
- pip install --upgrade .[big_mode] - pip install --upgrade .[big_mode]
- pip freeze - pip freeze
script: script:
- flake8 openslides tests
- isort --check-only --diff --recursive openslides tests
- python -m mypy openslides/ tests/ - python -m mypy openslides/ tests/
- python -W ignore -m pytest --cov --cov-fail-under=70 - python -W ignore -m pytest --cov --cov-fail-under=70
@ -36,6 +34,7 @@ matrix:
script: script:
- flake8 openslides tests - flake8 openslides tests
- isort --check-only --diff --recursive openslides tests - isort --check-only --diff --recursive openslides tests
- black --check --diff --py36 openslides tests
- python -m mypy openslides/ tests/ - python -m mypy openslides/ tests/
- python -W ignore -m pytest --cov --cov-fail-under=70 - python -W ignore -m pytest --cov --cov-fail-under=70

View File

@ -65,7 +65,7 @@ def min_requirements(args=None):
print(' '.join(get_lowest_versions(args.requirements))) print(' '.join(get_lowest_versions(args.requirements)))
@command('clear', @command('clean',
help='Deletes unneeded files and folders') help='Deletes unneeded files and folders')
def clean(args=None): def clean(args=None):
""" """
@ -76,7 +76,8 @@ def clean(args=None):
call('find -type d -empty -delete') call('find -type d -empty -delete')
@command('isort', @command('format',
help='Sorts all imports in all python files.') help='Format code with isort and black')
def isort(args=None): def isort(args=None):
return call('isort --recursive openslides tests') call('isort --recursive openslides tests')
call('black --py36 openslides tests')

View File

@ -1,3 +1,4 @@
black
coverage coverage
flake8 flake8
isort isort

View File

@ -15,6 +15,9 @@ include_trailing_comma = true
multi_line_output = 3 multi_line_output = 3
lines_after_imports = 2 lines_after_imports = 2
combine_as_imports = true combine_as_imports = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88
known_first_party = openslides known_first_party = openslides
known_third_party = pytest known_third_party = pytest