Skip to content

Commit 10da367

Browse files
committed
try flake8-import-order 0.19.2
the big new thang is that it is doing import order checks inside of TYPE_CHECKING blocks. Introduces some new codes that we enthusiastically add to our ignore list. Change-Id: I4e844408a8b218f9b92c43ad5e2a5c16781100be
1 parent adcccac commit 10da367

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: black
88

99
- repo: https://github.com/sqlalchemyorg/zimports
10-
rev: v0.6.0
10+
rev: v0.6.2
1111
hooks:
1212
- id: zimports
1313
args:
@@ -18,7 +18,7 @@ repos:
1818
hooks:
1919
- id: flake8
2020
additional_dependencies:
21-
- flake8-import-order!=0.19.0
21+
- flake8-import-order>=0.19.2
2222
- flake8-import-single==0.1.5
2323
- flake8-builtins
2424
- flake8-docstrings

alembic/util/sqla_compat.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@
3131
from sqlalchemy.sql.elements import ColumnClause
3232
from sqlalchemy.sql.elements import TextClause
3333
from sqlalchemy.sql.elements import UnaryExpression
34+
from sqlalchemy.sql.naming import _NONE_NAME as _NONE_NAME # type: ignore[attr-defined] # noqa: E501
3435
from sqlalchemy.sql.visitors import traverse
3536
from typing_extensions import TypeGuard
3637

37-
if True:
38-
from sqlalchemy.sql.naming import _NONE_NAME as _NONE_NAME # type: ignore[attr-defined] # noqa: E501
39-
4038
if TYPE_CHECKING:
4139
from sqlalchemy import ClauseElement
4240
from sqlalchemy import Identity
@@ -81,7 +79,7 @@ def compiles(
8179
) -> Callable[[_CompilerProtocol], _CompilerProtocol]: ...
8280

8381
else:
84-
from sqlalchemy.ext.compiler import compiles
82+
from sqlalchemy.ext.compiler import compiles # noqa: I100,I202
8583

8684

8785
identity_has_dialect_kwargs = issubclass(schema.Identity, DialectKWArgs)

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ignore =
55
A003,A005
66
D,
77
E203,E305,E704,E711,E712,E721,E722,E741,
8+
I300,
89
N801,N802,N806,
910
RST304,RST303,RST299,RST399,
1011
W503,W504

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ commands = {[testenv:pep484]commands}
8787
basepython = python3
8888
deps=
8989
flake8
90-
flake8-import-order!=0.19.0
90+
flake8-import-order>=0.19.2
9191
flake8-import-single==0.1.5
9292
flake8-builtins
9393
flake8-docstrings

0 commit comments

Comments
 (0)