Skip to content

Commit

Permalink
Fix the CI and bump linters
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat authored and erikseulean committed Feb 8, 2021
1 parent cf85b20 commit 7bcd12b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.
17 changes: 8 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ repos:
- id: black
args: [--safe]
- repo: https://github.com/asottile/blacken-docs
rev: v1.8.0
rev: v1.9.2
hooks:
- id: blacken-docs
args: [--skip-errors]
additional_dependencies: [black==19.3b0]
additional_dependencies: [black==20.8b1]
- repo: https://github.com/PyCQA/isort
rev: 5.6.3
rev: 5.7.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -25,18 +25,17 @@ repos:
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear == 20.1.4"]
language_version: python3.8
additional_dependencies: ["flake8-bugbear == 20.11.1"]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.15.0
rev: v1.16.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.9.0
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.6.0
rev: v1.7.0
hooks:
- id: rst-backticks
- repo: https://github.com/tox-dev/tox-ini-fmt
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ test =
pytest>=4
pytest-cov>=2.6
mock;python_version<'3.3'
typing;python_version<'3.4'

[options.package_data]
* = *.pyi
Expand Down
12 changes: 5 additions & 7 deletions src/attrs_strict/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from ._error import (
AttributeTypeError as AttributeTypeError,
BadTypeError as BadTypeError,
TupleError as TupleError,
TypeValidationError as TypeValidationError,
UnionError as UnionError,
)
from ._error import AttributeTypeError as AttributeTypeError
from ._error import BadTypeError as BadTypeError
from ._error import TupleError as TupleError
from ._error import TypeValidationError as TypeValidationError
from ._error import UnionError as UnionError
from ._type_validation import type_validator as type_validator
3 changes: 2 additions & 1 deletion src/attrs_strict/_error.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import inspect
import typing

import attr
import inspect

class TypeValidationError(Exception):
def __repr__(self) -> str: ...
Expand Down
1 change: 1 addition & 0 deletions src/attrs_strict/_type_validation.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import typing

import attr

def resolve_types(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def test_raises_when_container_is_empty_and_empty_ok_is_false():
validator(None, attr, items)

# THEN
assert "Smth can not be empty and must be str"
"(got None)" == str(error.value)
msg = "Smth can not be empty and must be {} (got [])".format(str)
assert msg == str(error.value)


def test_no_type_specified_is_fine():
Expand Down

0 comments on commit 7bcd12b

Please sign in to comment.