mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use strict flake8-type-checking settings in Ruff
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import io # NoQA: TC003
|
||||
from typing import Optional, overload
|
||||
from typing import TYPE_CHECKING, overload
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Optional
|
||||
|
||||
myint = int
|
||||
|
||||
|
@@ -1,6 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, overload
|
||||
from typing import TYPE_CHECKING, overload
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
|
||||
@overload
|
||||
|
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
from typing import Any # NoQA: TC003
|
||||
|
||||
CONSTANT = 'foo'
|
||||
SENTINEL = object()
|
||||
|
@@ -1,7 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pathlib
|
||||
from typing import Any, Tuple, TypeVar, Union # NoQA: UP035
|
||||
from typing import TYPE_CHECKING, Tuple, TypeVar, Union # NoQA: UP035
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
CONST1: int
|
||||
#: docstring
|
||||
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from contextlib import contextmanager
|
||||
from functools import lru_cache
|
||||
from typing import Generator # NoQA: UP035
|
||||
from typing import Generator # NoQA: TC003,UP035
|
||||
|
||||
|
||||
@lru_cache(maxsize=None) # NoQA: UP033
|
||||
|
@@ -21,7 +21,6 @@ from urllib3.poolmanager import PoolManager
|
||||
import sphinx.util.http_date
|
||||
from sphinx.builders.linkcheck import (
|
||||
CheckRequest,
|
||||
CheckResult,
|
||||
Hyperlink,
|
||||
HyperlinkAvailabilityCheckWorker,
|
||||
RateLimit,
|
||||
@@ -41,6 +40,9 @@ if TYPE_CHECKING:
|
||||
|
||||
from urllib3 import HTTPConnectionPool
|
||||
|
||||
from sphinx.builders.linkcheck import (
|
||||
CheckResult,
|
||||
)
|
||||
from sphinx.testing.util import SphinxTestApp
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user