Merge pull request #1416 from ostcar/isort

add isort
This commit is contained in:
Oskar Hahn 2015-02-17 07:44:29 +01:00
commit 7f8ad4bfcc
4 changed files with 14 additions and 2 deletions

View File

@ -15,6 +15,7 @@ install:
- "node_modules/.bin/gulp --production" - "node_modules/.bin/gulp --production"
script: script:
- "flake8 --max-line-length=150 --statistics openslides tests" - "flake8 --max-line-length=150 --statistics openslides tests"
- "isort --check-only --recursive openslides tests"
- "DJANGO_SETTINGS_MODULE='tests.settings' coverage run ./manage.py test tests.unit" - "DJANGO_SETTINGS_MODULE='tests.settings' coverage run ./manage.py test tests.unit"
- "coverage report --show-missing --fail-under=35" - "coverage report --show-missing --fail-under=35"

View File

@ -120,3 +120,9 @@ def po2json(args=None):
lang = args.language lang = args.language
call('node_modules/.bin/po2json openslides/locale/%s/javascript.po openslides/static/i18n/%s.json' % call('node_modules/.bin/po2json openslides/locale/%s/javascript.po openslides/static/i18n/%s.json' %
(lang, lang)) (lang, lang))
@command('isort',
help='Sorts all imports in all python files.')
def isort(args=None):
return call('isort --recursive openslides tests')

View File

@ -2,8 +2,9 @@
-r requirements_production.txt -r requirements_production.txt
# Requirements for development and tests in alphabetical order # Requirements for development and tests in alphabetical order
coverage==3.7.1 coverage
flake8==2.2.4 flake8
isort
# Requirements for OpenSlides handbook/documentation in alphabetical order # Requirements for OpenSlides handbook/documentation in alphabetical order
Sphinx==1.2.2 Sphinx==1.2.2

4
setup.cfg Normal file
View File

@ -0,0 +1,4 @@
[isort]
multi_line_output=3
include_trailing_comma=True
skip=main.py,signals.py,csv_import.py,global_settings.py,test_personal_info.py,tests.py,auth.py,search_indexes.py,test_list_of_speakers.py,chatbox.py,test_main_menu.py,test_config.py,runserver.py,rest_api.py,settings.py,test_pdf.py,__main__.py,test_serializers.py,autoupdate.py,pdf.py,widgets.py,models.py,test_csv_import.py,plugins.py,serializers.py,test_csv.py,test_overlays.py,backupdb.py,views.py,test_views.py,urls.py,forms.py,utils.py,test_auth.py