Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Reconfigure ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Jul 9, 2024
1 parent 132ca4a commit c5b36f5
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 11 deletions.
9 changes: 7 additions & 2 deletions nitro_generator_checker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
import asyncio
import logging
import sys
from typing import TYPE_CHECKING, Callable, Coroutine
from typing import TYPE_CHECKING

import aiofiles
import rich.traceback
from aiohttp import ClientSession, DummyCookieJar, TCPConnector
from rich.console import Console
from rich.logging import RichHandler
from typing_extensions import Any, TypeVar
from typing_extensions import TypeVar

from . import http
from .nitro_checker import NitroChecker
from .utils import bytes_decode

if TYPE_CHECKING:
from typing import Callable, Coroutine

from typing_extensions import Any

if sys.version_info >= (3, 11):
try:
import tomllib
Expand Down
6 changes: 5 additions & 1 deletion nitro_generator_checker/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

import ssl
from types import MappingProxyType
from typing import TYPE_CHECKING

import certifi
import charset_normalizer
from aiohttp import ClientResponse, hdrs
from aiohttp import hdrs

from .utils import bytes_decode

if TYPE_CHECKING:
from aiohttp import ClientResponse

SSL_CONTEXT = ssl.create_default_context(cafile=certifi.where())
HEADERS: MappingProxyType[str, str] = MappingProxyType({
hdrs.USER_AGENT: (
Expand Down
6 changes: 4 additions & 2 deletions nitro_generator_checker/nitro_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import asyncio
import logging
from typing import TYPE_CHECKING, Mapping
from typing import TYPE_CHECKING

from aiohttp import ClientSession, ClientTimeout
from aiohttp_socks import ProxyConnector
from rich.live import Live
from typing_extensions import Any, Self

from . import result_handlers, validators
from .counter import Counter
Expand All @@ -17,7 +16,10 @@
from .utils import create_background_task

if TYPE_CHECKING:
from typing import Mapping

from rich.console import Console
from typing_extensions import Any, Self

logger = logging.getLogger(__name__)

Expand Down
9 changes: 7 additions & 2 deletions nitro_generator_checker/proxy_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
import asyncio
import logging
import random
from typing import NoReturn
from typing import TYPE_CHECKING

from aiohttp import ClientSession, hdrs
from aiohttp import hdrs

from .http import get_response_text

if TYPE_CHECKING:
from typing import NoReturn

from aiohttp import ClientSession

logger = logging.getLogger(__name__)


Expand Down
6 changes: 5 additions & 1 deletion nitro_generator_checker/result_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
import stat
from abc import ABCMeta, abstractmethod
from pathlib import Path
from typing import TYPE_CHECKING

import aiofiles
from aiohttp import ClientConnectorError, ClientResponseError, ClientSession
from aiohttp import ClientConnectorError, ClientResponseError
from typing_extensions import override

from . import fs
from .utils import asyncify

if TYPE_CHECKING:
from aiohttp import ClientSession


class ABCResultHandler(metaclass=ABCMeta):
__slots__ = ()
Expand Down
9 changes: 7 additions & 2 deletions nitro_generator_checker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

import asyncio
import functools
from typing import Callable, Coroutine
from typing import TYPE_CHECKING

import charset_normalizer
from typing_extensions import Any, ParamSpec, TypeVar
from typing_extensions import ParamSpec, TypeVar

if TYPE_CHECKING:
from typing import Callable, Coroutine

from typing_extensions import Any

T = TypeVar("T")
P = ParamSpec("P")
Expand Down
9 changes: 8 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,28 @@ ignore = [
"PLR0915",
"PLR0916",
"PLR0917",
"PLR1702",
"RUF001",
"RUF002",
"RUF003",
"S110",
"S112",
"S308",
"S311",
"S404",
"SIM105",
"TID252",
"TRY400",
]
select = ["ALL"]
unfixable = ["T"]

[lint.flake8-self]
ignore-names = []
ignore-names = ["_name_", "_value_"]

[lint.flake8-type-checking]
exempt-modules = []
strict = true

[lint.isort]
combine-as-imports = true
Expand Down

0 comments on commit c5b36f5

Please sign in to comment.