mirror of
https://github.com/laramies/theHarvester.git
synced 2025-02-23 14:02:58 +08:00
Refactor core.py and update pyproject.toml configuration
Within core.py, the import statement for the 'Sized' attribute from 'collections.abc' is moved under a TYPE_CHECKING condition for better import flow control. The Ruff lint configuration in pyproject.toml has been simplified to select specific error codes and the `show-fixes` option has been enabled, allowing visibility of possible fixes for erring lines.
This commit is contained in:
parent
d36e326f77
commit
03e9bb34ef
2 changed files with 6 additions and 6 deletions
|
@ -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.
|
||||
|
|
|
@ -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/'),
|
||||
|
|
Loading…
Reference in a new issue