diff --git a/.flake8 b/.flake8 index 659394c8..343e13a4 100644 --- a/.flake8 +++ b/.flake8 @@ -4,10 +4,13 @@ show-source = True select = E,F,W,C,I,B,S,T,Q,N400 ignore = S101,S608 +extend-ignore = F821,E721 per-file-ignores = tests/test_init_import.py:F401 tests/conftest.py:S311 axion/handler/__init__.py:F811 +builtins = + _, import-order-style=appnexus application-package-names=axion @@ -18,7 +21,6 @@ hang-closing = false max-line-length = 90 inline-quotes = single -disable-noqa = True exclude = .git, __pycache__, diff --git a/axion/handler/analysis/return_type.py b/axion/handler/analysis/return_type.py index 53dbcc93..47c9cabc 100644 --- a/axion/handler/analysis/return_type.py +++ b/axion/handler/analysis/return_type.py @@ -90,7 +90,7 @@ def _analyze_headers( elif not types.is_dict_like(headers): return { exceptions.Error( - param_name=f'return.headers', + param_name='return.headers', reason=exceptions.IncorrectTypeReason( expected=model.COOKIES_HEADERS_TYPE, actual=headers, @@ -115,7 +115,7 @@ def _analyze_cookies( elif not types.is_dict_like(cookies): return { exceptions.Error( - param_name=f'return.cookies', + param_name='return.cookies', reason=exceptions.IncorrectTypeReason( expected=model.COOKIES_HEADERS_TYPE, actual=cookies, diff --git a/axion/oas/parser/type.py b/axion/oas/parser/type.py index e7e3cb5c..abee5778 100644 --- a/axion/oas/parser/type.py +++ b/axion/oas/parser/type.py @@ -381,7 +381,7 @@ def _resolve_oas_string( if min_length is not None and max_length is not None: if min_length > max_length: raise exceptions.OASInvalidConstraints( - f'type=string cannot have max_length < min_length. ', + 'type=string cannot have max_length < min_length. ', f'min_length={min_length} ' f'max_length={max_length}.', ) diff --git a/axion/utils/types.py b/axion/utils/types.py index eaa60c4a..7b2df66d 100644 --- a/axion/utils/types.py +++ b/axion/utils/types.py @@ -43,7 +43,7 @@ def is_new_type(tt: t.Type[t.Any]) -> bool: @functools.lru_cache(maxsize=30, typed=True) def is_none_type(tt: t.Type[t.Any]) -> bool: - return tt is type(None) # noqa + return tt is type(None) @functools.lru_cache(maxsize=30, typed=True) diff --git a/requirements/flake8.txt b/requirements/flake8.txt index 0caa162d..aed8cbc2 100644 --- a/requirements/flake8.txt +++ b/requirements/flake8.txt @@ -1,4 +1,4 @@ -flake8==3.7.9 +flake8==3.8.1 flake8-import-order==0.18.1 flake8-bugbear==20.1.4 flake8-commas==2.0.0 diff --git a/tests/test_oas_mixed_type.py b/tests/test_oas_mixed_type.py index 0c754197..b6484933 100644 --- a/tests/test_oas_mixed_type.py +++ b/tests/test_oas_mixed_type.py @@ -768,17 +768,17 @@ def _do() -> t.Any: raise AssertionError('This should not happen') elif isinstance(ap_1, bool) and isinstance(ap_2, dict): assert ( - f'additionalProperties value differs between mixed schemas. ' - f'a=bool != b=dict. When using "anyOf,oneOf,allOf" values in ' - f'same location must be equal. ' - f'Either make it so or remove one of the duplicating properties.' + 'additionalProperties value differs between mixed schemas. ' + 'a=bool != b=dict. When using "anyOf,oneOf,allOf" values in ' + 'same location must be equal. ' + 'Either make it so or remove one of the duplicating properties.' ) == str(err.value) elif isinstance(ap_1, dict) and isinstance(ap_2, bool): assert ( - f'additionalProperties value differs between mixed schemas. ' - f'a=dict != b=bool. When using "anyOf,oneOf,allOf" values in ' - f'same location must be equal. ' - f'Either make it so or remove one of the duplicating properties.' + 'additionalProperties value differs between mixed schemas. ' + 'a=dict != b=bool. When using "anyOf,oneOf,allOf" values in ' + 'same location must be equal. ' + 'Either make it so or remove one of the duplicating properties.' ) == str(err.value) else: raise AssertionError('This should not happen')