From 800055a5eaff28f65afe2bd7fb2a420804255ffc Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sun, 6 Jan 2019 16:15:56 +0100 Subject: [PATCH] Format code with black --- .travis.yml | 3 +-- make/commands.py | 9 +++++---- requirements/development.txt | 1 + setup.cfg | 3 +++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fbd5a0633..09da80096 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,6 @@ matrix: - pip install --upgrade .[big_mode] - pip freeze script: - - flake8 openslides tests - - isort --check-only --diff --recursive openslides tests - python -m mypy openslides/ tests/ - python -W ignore -m pytest --cov --cov-fail-under=70 @@ -36,6 +34,7 @@ matrix: script: - flake8 openslides tests - isort --check-only --diff --recursive openslides tests + - black --check --diff --py36 openslides tests - python -m mypy openslides/ tests/ - python -W ignore -m pytest --cov --cov-fail-under=70 diff --git a/make/commands.py b/make/commands.py index a190688c3..5e7f359fb 100644 --- a/make/commands.py +++ b/make/commands.py @@ -65,7 +65,7 @@ def min_requirements(args=None): print(' '.join(get_lowest_versions(args.requirements))) -@command('clear', +@command('clean', help='Deletes unneeded files and folders') def clean(args=None): """ @@ -76,7 +76,8 @@ def clean(args=None): call('find -type d -empty -delete') -@command('isort', - help='Sorts all imports in all python files.') +@command('format', + help='Format code with isort and black') def isort(args=None): - return call('isort --recursive openslides tests') + call('isort --recursive openslides tests') + call('black --py36 openslides tests') diff --git a/requirements/development.txt b/requirements/development.txt index 870c431d1..e03a713f6 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -1,3 +1,4 @@ +black coverage flake8 isort diff --git a/setup.cfg b/setup.cfg index 815a1050d..af6fe7b2b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,6 +15,9 @@ include_trailing_comma = true multi_line_output = 3 lines_after_imports = 2 combine_as_imports = true +force_grid_wrap = 0 +use_parentheses = true +line_length = 88 known_first_party = openslides known_third_party = pytest