Skip to content

Commit

Permalink
feat: remove deprecated ignore_*/skip_* options (#596)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Maas <fpgmaas@gmail.com>
  • Loading branch information
mkniewallner and fpgmaas authored Mar 18, 2024
1 parent b3b1e8e commit d8bce84
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 473 deletions.
90 changes: 2 additions & 88 deletions python/deptry/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

from deptry.config import read_configuration_from_pyproject_toml
from deptry.core import Core
from deptry.deprecate.ignore_flags import get_value_for_per_rule_ignores_argument
from deptry.deprecate.skip_flags import get_value_for_ignore_argument

if TYPE_CHECKING:
from collections.abc import MutableMapping, Sequence
from collections.abc import Mapping, MutableMapping, Sequence

if sys.platform == "win32":
from colorama import just_fix_windows_console
Expand Down Expand Up @@ -132,64 +130,6 @@ def display_deptry_version(ctx: click.Context, _param: click.Parameter, value: b
is_flag=True,
help="Disable ANSI characters in terminal output.",
)
@click.option("--skip-obsolete", is_flag=True, hidden=True)
@click.option(
"--skip-unused",
is_flag=True,
help="To be deprecated.",
hidden=True,
)
@click.option(
"--skip-missing",
is_flag=True,
help="To be deprecated.",
hidden=True,
)
@click.option(
"--skip-transitive",
is_flag=True,
help="To be deprecated.",
hidden=True,
)
@click.option(
"--skip-misplaced-dev",
is_flag=True,
help="To be deprecated.",
hidden=True,
)
@click.option("--ignore-obsolete", "-io", help="To be deprecated.", type=COMMA_SEPARATED_TUPLE, default=(), hidden=True)
@click.option(
"--ignore-unused",
"-iu",
type=COMMA_SEPARATED_TUPLE,
hidden=True,
help="To be deprecated.",
default=(),
)
@click.option(
"--ignore-missing",
"-im",
type=COMMA_SEPARATED_TUPLE,
hidden=True,
help="To be deprecated.",
default=(),
)
@click.option(
"--ignore-transitive",
"-it",
type=COMMA_SEPARATED_TUPLE,
hidden=True,
help="To be deprecated.",
default=(),
)
@click.option(
"--ignore-misplaced-dev",
"-id",
type=COMMA_SEPARATED_TUPLE,
hidden=True,
help="To be deprecated.",
default=(),
)
@click.option(
"--ignore",
"-i",
Expand Down Expand Up @@ -288,18 +228,8 @@ def deptry(
root: tuple[Path, ...],
config: Path,
no_ansi: bool,
ignore_unused: tuple[str, ...],
ignore_obsolete: tuple[str, ...],
ignore_missing: tuple[str, ...],
ignore_transitive: tuple[str, ...],
ignore_misplaced_dev: tuple[str, ...],
skip_unused: bool,
skip_obsolete: bool,
skip_missing: bool,
skip_transitive: bool,
skip_misplaced_dev: bool,
ignore: tuple[str, ...],
per_rule_ignores: MutableMapping[str, tuple[str, ...]],
per_rule_ignores: Mapping[str, tuple[str, ...]],
exclude: tuple[str, ...],
extend_exclude: tuple[str, ...],
ignore_notebooks: bool,
Expand All @@ -322,22 +252,6 @@ def deptry(
deptry src worker
"""
ignore = get_value_for_ignore_argument(
ignore,
skip_missing=skip_missing,
skip_obsolete=skip_obsolete,
skip_unused=skip_unused,
skip_transitive=skip_transitive,
skip_misplaced_dev=skip_misplaced_dev,
)
per_rule_ignores = get_value_for_per_rule_ignores_argument(
per_rule_ignores=per_rule_ignores,
ignore_missing=ignore_missing,
ignore_obsolete=ignore_obsolete,
ignore_unused=ignore_unused,
ignore_misplaced_dev=ignore_misplaced_dev,
ignore_transitive=ignore_transitive,
)
Core(
root=root,
config=config,
Expand Down
74 changes: 0 additions & 74 deletions python/deptry/deprecate/ignore_flags.py

This file was deleted.

67 changes: 0 additions & 67 deletions python/deptry/deprecate/skip_flags.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ pkginfo = "^1.8.3"
[tool.poetry.dev-dependencies]
black = "^22.6.0"

[tool.deptry]
ignore_obsolete = ["pkginfo"]
[tool.deptry.per_rule_ignores]
DEP002 = ["pkginfo"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ dependencies = ["toml"]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"

[tool.deptry]
ignore_obsolete = ["pkginfo"]
[tool.deptry.per_rule_ignores]
DEP002 = ["pkginfo"]
2 changes: 1 addition & 1 deletion tests/functional/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def test_cli_ignore_notebooks(poetry_venv_factory: PoetryVenvFactory) -> None:
@pytest.mark.xdist_group(name=Project.EXAMPLE)
def test_cli_ignore_flags(poetry_venv_factory: PoetryVenvFactory) -> None:
with poetry_venv_factory(Project.EXAMPLE) as virtual_env:
result = virtual_env.run("deptry . --per-rule-ignores DEP002=isort|pkginfo|requests -im white -id black")
result = virtual_env.run("deptry . --per-rule-ignores DEP001=white,DEP002=isort|pkginfo|requests,DEP004=black")

assert result.returncode == 0

Expand Down
Loading

0 comments on commit d8bce84

Please sign in to comment.