Reconfigure ruff
This commit is contained in:
@@ -3,7 +3,7 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
import logging
|
||||
import sys
|
||||
from typing import TYPE_CHECKING, Callable, Coroutine, Mapping
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import aiofiles
|
||||
import rich.traceback
|
||||
@@ -12,7 +12,7 @@ from rich.console import Console
|
||||
from rich.logging import RichHandler
|
||||
from rich.progress import BarColumn, MofNCompleteColumn, Progress, TextColumn
|
||||
from rich.table import Table
|
||||
from typing_extensions import Any, TypeVar
|
||||
from typing_extensions import TypeVar
|
||||
|
||||
from . import checker, geodb, http, output, scraper, sort, utils
|
||||
from .settings import Settings
|
||||
@@ -29,7 +29,10 @@ else:
|
||||
import tomli as tomllib
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Callable, Coroutine, Mapping
|
||||
|
||||
from aiohttp_socks import ProxyType
|
||||
from typing_extensions import Any
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Mapping
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from . import sort
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Mapping
|
||||
|
||||
from aiohttp_socks import ProxyType
|
||||
from rich.progress import Progress, TaskID
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import stat
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import aiofiles
|
||||
from aiohttp import ClientResponse, ClientSession, hdrs
|
||||
from aiohttp import hdrs
|
||||
|
||||
from . import fs
|
||||
from .utils import IS_DOCKER, asyncify, bytes_decode
|
||||
@@ -13,6 +13,7 @@ from .utils import IS_DOCKER, asyncify, bytes_decode
|
||||
if TYPE_CHECKING:
|
||||
import asyncio
|
||||
|
||||
from aiohttp import ClientResponse, ClientSession
|
||||
from rich.progress import Progress, TaskID
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -3,12 +3,16 @@ from __future__ import annotations
|
||||
import ssl
|
||||
from functools import lru_cache
|
||||
from types import MappingProxyType
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import certifi
|
||||
from aiohttp import ClientResponse, DummyCookieJar, hdrs
|
||||
from aiohttp import DummyCookieJar, hdrs
|
||||
|
||||
from .utils import bytes_decode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from aiohttp import ClientResponse
|
||||
|
||||
HEADERS: MappingProxyType[str, str] = MappingProxyType({
|
||||
hdrs.USER_AGENT: (
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" # noqa: E501
|
||||
|
||||
@@ -4,7 +4,7 @@ import json
|
||||
import logging
|
||||
import stat
|
||||
from shutil import rmtree
|
||||
from typing import TYPE_CHECKING, Sequence
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import maxminddb
|
||||
|
||||
@@ -14,6 +14,8 @@ from .null_context import NullContext
|
||||
from .utils import IS_DOCKER, asyncify
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Sequence
|
||||
|
||||
from .proxy import Proxy
|
||||
from .settings import Settings
|
||||
from .storage import ProxyStorage
|
||||
|
||||
@@ -3,10 +3,11 @@ from __future__ import annotations
|
||||
import json
|
||||
from io import StringIO
|
||||
from time import perf_counter
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import attrs
|
||||
from aiohttp import ClientSession
|
||||
from aiohttp_socks import ProxyConnector, ProxyType
|
||||
from aiohttp_socks import ProxyConnector
|
||||
|
||||
from .http import (
|
||||
HEADERS,
|
||||
@@ -16,7 +17,12 @@ from .http import (
|
||||
get_response_text,
|
||||
)
|
||||
from .parsers import parse_ipv4
|
||||
from .settings import CheckWebsiteType, Settings
|
||||
from .settings import CheckWebsiteType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from aiohttp_socks import ProxyType
|
||||
|
||||
from .settings import Settings
|
||||
|
||||
|
||||
@attrs.define(
|
||||
|
||||
@@ -6,7 +6,7 @@ import logging
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import aiofiles
|
||||
from aiohttp import ClientResponseError, ClientSession, ClientTimeout
|
||||
from aiohttp import ClientResponseError, ClientTimeout
|
||||
from aiohttp_socks import ProxyType
|
||||
|
||||
from .http import get_response_text
|
||||
@@ -15,6 +15,7 @@ from .proxy import Proxy
|
||||
from .utils import bytes_decode, is_http_url
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from aiohttp import ClientSession
|
||||
from rich.progress import Progress, TaskID
|
||||
|
||||
from .settings import Settings
|
||||
|
||||
@@ -9,14 +9,13 @@ import stat
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from types import MappingProxyType
|
||||
from typing import TYPE_CHECKING, Callable, Iterable, Mapping
|
||||
from typing import TYPE_CHECKING
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import attrs
|
||||
import platformdirs
|
||||
from aiohttp import ClientSession, ClientTimeout, hdrs
|
||||
from aiohttp import ClientTimeout, hdrs
|
||||
from aiohttp_socks import ProxyType
|
||||
from typing_extensions import Any, Literal, Self
|
||||
|
||||
from . import fs, sort
|
||||
from .http import get_response_text
|
||||
@@ -25,6 +24,11 @@ from .parsers import parse_ipv4
|
||||
from .utils import IS_DOCKER
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Callable, Iterable, Mapping
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from typing_extensions import Any, Literal, Self
|
||||
|
||||
from .proxy import Proxy
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,11 +2,13 @@ from __future__ import annotations
|
||||
|
||||
import itertools
|
||||
from collections import Counter
|
||||
from typing import TYPE_CHECKING, Iterable, Iterator
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from . import sort
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Iterable, Iterator
|
||||
|
||||
from aiohttp_socks import ProxyType
|
||||
|
||||
from .proxy import Proxy
|
||||
|
||||
@@ -3,12 +3,15 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
import functools
|
||||
import os
|
||||
from typing import Callable
|
||||
from typing import TYPE_CHECKING
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import charset_normalizer
|
||||
from typing_extensions import ParamSpec, TypeVar
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Callable
|
||||
|
||||
T = TypeVar("T")
|
||||
P = ParamSpec("P")
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ ignore = [
|
||||
"PLR0915",
|
||||
"PLR0916",
|
||||
"PLR0917",
|
||||
"PLR1702",
|
||||
"RUF001",
|
||||
"RUF002",
|
||||
"RUF003",
|
||||
@@ -42,15 +43,21 @@ ignore = [
|
||||
"S112",
|
||||
"S308",
|
||||
"S311",
|
||||
"S404",
|
||||
"SIM105",
|
||||
"TID252",
|
||||
"TRY400",
|
||||
]
|
||||
select = ["ALL"]
|
||||
unfixable = ["T"]
|
||||
|
||||
[lint.flake8-self]
|
||||
ignore-names = ["_name_", "_value_"]
|
||||
|
||||
[lint.flake8-type-checking]
|
||||
exempt-modules = []
|
||||
strict = true
|
||||
|
||||
[lint.isort]
|
||||
combine-as-imports = true
|
||||
required-imports = ["from __future__ import annotations"]
|
||||
|
||||
Reference in New Issue
Block a user