Skip to content

Commit

Permalink
Add isort and flake8 checks
Browse files Browse the repository at this point in the history
  • Loading branch information
kvesteri committed Oct 10, 2015
1 parent 7148bb8 commit ef06b9e
Show file tree
Hide file tree
Showing 31 changed files with 41 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
known_first_party=sqlalchemy_utils,tests
line_length=79
multi_line_output=3
not_skip=__init__.py
order_by_type=false
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ python:
install:
- pip install -e ".[test]"
script:
- isort --recursive --diff validators tests && isort --recursive --check-only validators tests
- flake8 validators tests
- py.test --doctest-glob="*.rst" --doctest-modules --ignore=setup.py
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changelog
^^^^^^^^^^^^^^^^^^

- Added new validator: ``domain``
- Added flake8 and isort checks in travis config


0.8.0 (2015-06-24)
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def get_version():
extras_require = {
'test': [
'pytest>=2.2.3',
'flake8>=2.4.0',
'isort==3.9.6',
'natsort==3.5.6',
],
}

Expand Down
1 change: 1 addition & 0 deletions tests/i18n/test_fi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import fi_business_id, fi_ssn, ValidationFailure


Expand Down
1 change: 1 addition & 0 deletions tests/test_between.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

import validators


Expand Down
1 change: 1 addition & 0 deletions tests/test_domain.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import domain, ValidationFailure


Expand Down
1 change: 1 addition & 0 deletions tests/test_email.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import email, ValidationFailure


Expand Down
1 change: 1 addition & 0 deletions tests/test_extremes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import Max, Min


Expand Down
1 change: 1 addition & 0 deletions tests/test_iban.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

import validators


Expand Down
1 change: 1 addition & 0 deletions tests/test_ipv4.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import ipv4, ValidationFailure


Expand Down
1 change: 1 addition & 0 deletions tests/test_ipv6.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import ipv6, ValidationFailure


Expand Down
1 change: 1 addition & 0 deletions tests/test_length.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

import validators


Expand Down
1 change: 1 addition & 0 deletions tests/test_mac_address.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import mac_address, ValidationFailure


Expand Down
1 change: 1 addition & 0 deletions tests/test_slug.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import slug, ValidationFailure


Expand Down
1 change: 1 addition & 0 deletions tests/test_url.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import url, ValidationFailure


Expand Down
1 change: 1 addition & 0 deletions tests/test_uuid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest

from validators import uuid, ValidationFailure


Expand Down
2 changes: 1 addition & 1 deletion tests/test_validation_failure.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import validators
import six

import validators

obj_repr = (
"ValidationFailure(func=between"
Expand Down
4 changes: 2 additions & 2 deletions validators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from .between import between # noqa
from .domain import domain # noqa
from .email import email # noqa
from .extremes import Min, Max # noqa
from .extremes import Max, Min # noqa
from .i18n import fi_business_id, fi_ssn # noqa
from .iban import iban # noqa
from .ip_address import ipv4, ipv6 # noqa
from .i18n import fi_business_id, fi_ssn # noqa
from .length import length # noqa
from .mac_address import mac_address # noqa
from .slug import slug # noqa
Expand Down
2 changes: 1 addition & 1 deletion validators/between.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .extremes import Min, Max
from .extremes import Max, Min
from .utils import validator


Expand Down
1 change: 1 addition & 0 deletions validators/domain.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re

from .utils import validator

pattern = re.compile(
Expand Down
2 changes: 1 addition & 1 deletion validators/email.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from .utils import validator

from .utils import validator

user_regex = re.compile(
# dot-atom
Expand Down
2 changes: 1 addition & 1 deletion validators/i18n/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .fi import fi_ssn, fi_business_id # noqa
from .fi import fi_business_id, fi_ssn # noqa
2 changes: 1 addition & 1 deletion validators/i18n/fi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from validators.utils import validator

from validators.utils import validator

business_id_pattern = re.compile(r'^[0-9]{7}-[0-9]$')
ssn_checkmarks = '0123456789ABCDEFHJKLMNPRSTUVWXY'
Expand Down
1 change: 1 addition & 0 deletions validators/iban.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re

from .utils import validator

regex = (
Expand Down
2 changes: 1 addition & 1 deletion validators/mac_address.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from .utils import validator

from .utils import validator

pattern = re.compile(r'^(?:[0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$')

Expand Down
2 changes: 1 addition & 1 deletion validators/slug.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from .utils import validator

from .utils import validator

slug_regex = re.compile(r'^[-a-zA-Z0-9_]+$')

Expand Down
1 change: 1 addition & 0 deletions validators/truthy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import six

from .utils import validator


Expand Down
2 changes: 1 addition & 1 deletion validators/url.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from .utils import validator

from .utils import validator

regex = (
r'^[a-z]+://([^/:]+{tld}|([0-9]{{1,3}}\.)'
Expand Down
3 changes: 2 additions & 1 deletion validators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from decorator import decorator
import inspect
import itertools

import six
from decorator import decorator


class ValidationFailure(object):
Expand Down
2 changes: 1 addition & 1 deletion validators/uuid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from .utils import validator

from .utils import validator

pattern = re.compile(r'^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$')

Expand Down

0 comments on commit ef06b9e

Please sign in to comment.