diff --git a/pyproject.toml b/pyproject.toml index 41e13faa..d3424366 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,13 +79,11 @@ exclude = [ ] line-length = 130 - target-version = "py310" +show-fixes = true [tool.ruff.lint] -# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. -# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or -select = ["E4", "E7", "E9", "F", "I", "UP"] +select = ["E4", "E7", "E9", "F", "I", "UP", "TCH"] ignore = [] # Allow fix for all enabled rules (when `--fix`) is provided. diff --git a/theHarvester/lib/core.py b/theHarvester/lib/core.py index 9a4915fc..84a656d9 100644 --- a/theHarvester/lib/core.py +++ b/theHarvester/lib/core.py @@ -4,9 +4,8 @@ import contextlib import random import ssl -from collections.abc import Sized from pathlib import Path -from typing import Any +from typing import TYPE_CHECKING, Any import aiohttp import certifi @@ -17,6 +16,9 @@ from .version import version +if TYPE_CHECKING: + from collections.abc import Sized + DATA_DIR = Path(__file__).parents[1] / 'data' CONFIG_DIRS = [ Path('/etc/theHarvester/'),