mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
Update flake8 to 3.5.0 (#88)
* Update flake8 from 3.4.1 to 3.5.0 * fix linting with flake8 3.5
This commit is contained in:
committed by
Samuel Colvin
parent
6f3ceb07d5
commit
06d971ae4d
+4
-4
@@ -56,14 +56,14 @@ class ConstrainedStr(str):
|
||||
if value is None:
|
||||
raise TypeError('None is not an allow value')
|
||||
|
||||
l = len(value)
|
||||
if cls.min_length is not None and l < cls.min_length:
|
||||
v_len = len(value)
|
||||
if cls.min_length is not None and v_len < cls.min_length:
|
||||
raise ValueError(f'length less than minimum allowed: {cls.min_length}')
|
||||
|
||||
if cls.curtail_length:
|
||||
if l > cls.curtail_length:
|
||||
if v_len > cls.curtail_length:
|
||||
value = value[:cls.curtail_length]
|
||||
elif cls.max_length is not None and l > cls.max_length:
|
||||
elif cls.max_length is not None and v_len > cls.max_length:
|
||||
raise ValueError(f'length greater than maximum allowed: {cls.max_length}')
|
||||
|
||||
if cls.regex:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
coverage==4.4.1
|
||||
flake8==3.4.1
|
||||
flake8==3.5.0
|
||||
isort==4.2.15
|
||||
mypy==0.540
|
||||
pycodestyle==2.3.1
|
||||
|
||||
Reference in New Issue
Block a user