mirror of
https://github.com/jazzband/django-discover-jenkins.git
synced 2026-03-16 22:20:28 +00:00
Added isort to CI.
This commit is contained in:
parent
ea2b0d4464
commit
67829eb216
16 changed files with 42 additions and 24 deletions
|
|
@ -4,6 +4,7 @@ language: python
|
|||
|
||||
env:
|
||||
- TOXENV=flake8
|
||||
- TOXENV=isort
|
||||
- TOXENV=py27-1.7
|
||||
- TOXENV=py27-1.8
|
||||
- TOXENV=py27-1.9
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import os
|
|||
import traceback
|
||||
from datetime import datetime
|
||||
from itertools import groupby
|
||||
from unittest import TextTestResult
|
||||
from xml.sax.saxutils import XMLGenerator
|
||||
from xml.sax.xmlreader import AttributesImpl
|
||||
from unittest import TextTestResult
|
||||
|
||||
from django.utils.encoding import smart_text
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import unittest
|
||||
from optparse import make_option
|
||||
from importlib import import_module
|
||||
from optparse import make_option
|
||||
|
||||
import django
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.test.runner import DiscoverRunner
|
||||
|
||||
from .results import XMLTestResult
|
||||
from .settings import TASKS, OUTPUT_DIR
|
||||
from .settings import OUTPUT_DIR, TASKS
|
||||
|
||||
|
||||
def get_tasks():
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
from django.conf import settings
|
||||
|
||||
|
||||
TASKS = getattr(settings, 'TEST_TASKS', (
|
||||
'discover_jenkins.tasks.run_pylint.PyLintTask',
|
||||
'discover_jenkins.tasks.with_coverage.CoverageTask',
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
# coding: utf-8
|
||||
import os
|
||||
import sys
|
||||
from optparse import make_option
|
||||
|
||||
import django
|
||||
import pep8
|
||||
from flake8.engine import get_style_guide
|
||||
from optparse import make_option
|
||||
import django
|
||||
from discover_jenkins.tasks.run_pep8 import Pep8Task
|
||||
from discover_jenkins.utils import get_app_locations
|
||||
|
||||
from ..utils import get_app_locations
|
||||
from .run_pep8 import Pep8Task
|
||||
|
||||
|
||||
class Flake8Task(Pep8Task):
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import sys
|
||||
import codecs
|
||||
import fnmatch
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from optparse import make_option
|
||||
|
||||
import django
|
||||
from django.conf import settings as django_settings
|
||||
|
||||
from ..settings import JSHINT_CHECKED_FILES, JSHINT_EXCLUDE, JSHINT_RCFILE
|
||||
from ..utils import CalledProcessError, get_app_locations
|
||||
from ..settings import JSHINT_CHECKED_FILES, JSHINT_RCFILE, JSHINT_EXCLUDE
|
||||
|
||||
|
||||
class JSHintTask(object):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import sys
|
||||
import pep8
|
||||
from optparse import make_option
|
||||
|
||||
import django
|
||||
import pep8
|
||||
from django.conf import settings
|
||||
from discover_jenkins.utils import get_app_locations
|
||||
|
||||
from ..utils import get_app_locations
|
||||
|
||||
|
||||
class Pep8Task(object):
|
||||
|
|
|
|||
|
|
@ -5,11 +5,10 @@ import sys
|
|||
from optparse import make_option
|
||||
|
||||
import django
|
||||
|
||||
from pylint import lint
|
||||
from pylint.reporters.text import ParseableTextReporter
|
||||
|
||||
from ..settings import PYLINT_RCFILE, PROJECT_APPS
|
||||
from ..settings import PROJECT_APPS, PYLINT_RCFILE
|
||||
|
||||
|
||||
def default_config_path():
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from optparse import make_option
|
||||
import subprocess
|
||||
|
||||
import django
|
||||
from discover_jenkins.utils import get_app_locations
|
||||
|
||||
from ..utils import get_app_locations
|
||||
|
||||
|
||||
class SlocCountTask(object):
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ from optparse import make_option
|
|||
|
||||
import django
|
||||
|
||||
from .. import settings
|
||||
|
||||
try:
|
||||
from coverage import coverage
|
||||
except ImportError:
|
||||
from coverage.control import coverage
|
||||
|
||||
from .. import settings
|
||||
|
||||
|
||||
def default_config_path():
|
||||
rcfile = settings.COVERAGE_RCFILE
|
||||
|
|
|
|||
|
|
@ -3,5 +3,11 @@ ignore = E123,E128,E402,W503,E731,W601
|
|||
max-line-length = 119
|
||||
exclude = docs,tests/test_project/test_app/migrations/*
|
||||
|
||||
[isort]
|
||||
combine_as_imports=true
|
||||
include_trailing_comma=true
|
||||
multi_line_output=5
|
||||
not_skip=__init__.py
|
||||
|
||||
[wheel]
|
||||
universal = 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
DEBUG = True
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
a = 1 # pyflakes/pylint violation
|
||||
a = 1 # pyflakes/pylint violation
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
from unittest import skipIf
|
||||
|
||||
import django
|
||||
from django.test import TestCase
|
||||
|
||||
from discover_jenkins import runner, tasks
|
||||
from django.test import TestCase
|
||||
|
||||
try:
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import os
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
import discover_jenkins
|
||||
import test_project
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class TestUtils(TestCase):
|
||||
|
|
|
|||
8
tox.ini
8
tox.ini
|
|
@ -2,6 +2,7 @@
|
|||
args_are_paths = false
|
||||
envlist =
|
||||
flake8,
|
||||
isort,
|
||||
py27-{1.7,1.8,1.9,master},
|
||||
py32-{1.7,1.8},
|
||||
py33-{1.7,1.8},
|
||||
|
|
@ -38,3 +39,10 @@ deps =
|
|||
basepython = python2.7
|
||||
commands =
|
||||
flake8
|
||||
|
||||
[testenv:isort]
|
||||
basepython = python2.7
|
||||
commands =
|
||||
isort --recursive --check-only --diff discover_jenkins tests
|
||||
deps =
|
||||
isort
|
||||
|
|
|
|||
Loading…
Reference in a new issue