Fix linting errors

Remove unused imports
Disable redundant errors
Add notes for why errors are disabled
This commit is contained in:
Ethan Paul 2024-08-15 14:41:34 -04:00 committed by Ethan Paul
parent 6837a64121
commit f37463d172
Signed by: enpaul
GPG Key ID: 07F53B438281D181
9 changed files with 15 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# pylint: disable=missing-module-docstring, missing-function-docstring, unused-argument, too-few-public-methods # pylint: disable=missing-module-docstring,missing-function-docstring,unused-argument,too-few-public-methods,protected-access
import time import time
from pathlib import Path from pathlib import Path
from typing import List from typing import List

View File

@ -1,4 +1,4 @@
# pylint: disable=missing-module-docstring, redefined-outer-name, unused-argument, wrong-import-order, unused-import # pylint: disable=missing-module-docstring,redefined-outer-name,unused-argument,unused-import,protected-access
import time import time
from unittest import mock from unittest import mock

View File

@ -1,13 +1,11 @@
# pylint: disable=missing-module-docstring, redefined-outer-name, unused-argument, wrong-import-order, unused-import # pylint: disable=missing-module-docstring,redefined-outer-name,unused-argument,unused-import,protected-access
import poetry.factory import poetry.factory
import poetry.utils.env import poetry.utils.env
import pytest import pytest
from poetry.puzzle.provider import Provider
import tox_poetry_installer.hooks._tox_on_install_helpers import tox_poetry_installer.hooks._tox_on_install_helpers
from .fixtures import mock_poetry_factory from .fixtures import mock_poetry_factory
from .fixtures import mock_venv from .fixtures import mock_venv
from tox_poetry_installer import constants
from tox_poetry_installer import exceptions from tox_poetry_installer import exceptions

View File

@ -21,13 +21,13 @@ at the module scope it is imported into function scope wherever Poetry component
moves import errors from load time to runtime which allows the plugin to be skipped if Poetry isn't moves import errors from load time to runtime which allows the plugin to be skipped if Poetry isn't
installed and/or a more helpful error be raised within the Tox framework. installed and/or a more helpful error be raised within the Tox framework.
""" """
# pylint: disable=unused-import
import sys import sys
from tox_poetry_installer import exceptions from tox_poetry_installer import exceptions
try: try:
# pylint: disable=import-outside-toplevel,unused-import
from cleo.io.null_io import NullIO from cleo.io.null_io import NullIO
from poetry.config.config import Config from poetry.config.config import Config
from poetry.core.packages.dependency import Dependency as PoetryDependency from poetry.core.packages.dependency import Dependency as PoetryDependency

View File

@ -5,7 +5,6 @@ in this module.
All constants should be type hinted. All constants should be type hinted.
""" """
from typing import Set
from typing import Tuple from typing import Tuple
from tox_poetry_installer import __about__ from tox_poetry_installer import __about__

View File

@ -23,6 +23,10 @@ from tox_poetry_installer import logger
if typing.TYPE_CHECKING: if typing.TYPE_CHECKING:
from tox_poetry_installer import _poetry from tox_poetry_installer import _poetry
# This is globally disabled to support the usage of the _poetry shadow module
# pylint: disable=import-outside-toplevel
PackageMap = Dict[str, List[PoetryPackage]] PackageMap = Dict[str, List[PoetryPackage]]

View File

@ -5,8 +5,11 @@ from tox.config.sets import EnvConfigSet
from tox.plugin import impl from tox.plugin import impl
# pylint: disable=missing-function-docstring
@impl @impl
def tox_add_env_config(env_conf: EnvConfigSet): def tox_add_env_config(
env_conf: EnvConfigSet,
):
env_conf.add_config( env_conf.add_config(
"poetry_dep_groups", "poetry_dep_groups",
of_type=List[str], of_type=List[str],

View File

@ -5,6 +5,7 @@ from tox.plugin import impl
from tox_poetry_installer import constants from tox_poetry_installer import constants
# pylint: disable=missing-function-docstring
@impl @impl
def tox_add_option(parser: ToxParser): def tox_add_option(parser: ToxParser):
parser.add_argument( parser.add_argument(

View File

@ -21,10 +21,9 @@ from tox_poetry_installer.hooks._tox_on_install_helpers import find_project_deps
from tox_poetry_installer.hooks._tox_on_install_helpers import install_package from tox_poetry_installer.hooks._tox_on_install_helpers import install_package
# pylint: disable=missing-function-docstring,unused-argument
@impl @impl
def tox_on_install( def tox_on_install(tox_env: ToxVirtualEnv, *args) -> None:
tox_env: ToxVirtualEnv, section: str # pylint: disable=unused-argument
) -> None:
try: try:
poetry = check_preconditions(tox_env) poetry = check_preconditions(tox_env)
except exceptions.SkipEnvironment as err: except exceptions.SkipEnvironment as err: