Skip to content

Commit

Permalink
refactor(cli): remove obsolete cli_defaults module (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkniewallner authored Nov 18, 2022
1 parent aa7e172 commit 57a2e36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
18 changes: 8 additions & 10 deletions deptry/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import click

from deptry.cli_defaults import DEFAULTS
from deptry.compat import metadata
from deptry.config import read_configuration_from_pyproject_toml
from deptry.core import Core
Expand Down Expand Up @@ -80,7 +79,7 @@ def configure_logger(ctx: click.Context, _param: click.Parameter, value: bool) -
Comma-separated list of dependencies that should never be marked as obsolete, even if they are not imported in any of the files scanned.
For example; `deptry . --ignore-obsolete foo,bar`.
""",
default=DEFAULTS["ignore_obsolete"],
default=(),
)
@click.option(
"--ignore-missing",
Expand All @@ -89,7 +88,7 @@ def configure_logger(ctx: click.Context, _param: click.Parameter, value: bool) -
help="""Comma-separated list of modules that should never be marked as missing dependencies, even if the matching package for the import statement cannot be found.
For example; `deptry . --ignore-missing foo,bar`.
""",
default=DEFAULTS["ignore_missing"],
default=(),
)
@click.option(
"--ignore-transitive",
Expand All @@ -98,7 +97,7 @@ def configure_logger(ctx: click.Context, _param: click.Parameter, value: bool) -
help="""Comma-separated list of dependencies that should never be marked as an issue due to it being a transitive dependency, even though deptry determines them to be transitive.
For example; `deptry . --ignore-transitive foo,bar`.
""",
default=DEFAULTS["ignore_transitive"],
default=(),
)
@click.option(
"--ignore-misplaced-dev",
Expand All @@ -107,7 +106,7 @@ def configure_logger(ctx: click.Context, _param: click.Parameter, value: bool) -
help="""Comma-separated list of modules that should never be marked as a misplaced development dependency, even though it seems to not be used solely for development purposes.
For example; `deptry . --ignore-misplaced-dev foo,bar`.
""",
default=DEFAULTS["ignore_misplaced_dev"],
default=(),
)
@click.option(
"--exclude",
Expand All @@ -118,7 +117,7 @@ def configure_logger(ctx: click.Context, _param: click.Parameter, value: bool) -
Can be used multiple times by specifying the argument multiple times. re.match() is used to match the expressions, which by default checks for a match only at the beginning of a string.
For example: `deptry . -e ".*/foo/" -e bar"` Note that this overwrites the defaults.
""",
default=DEFAULTS["exclude"],
default=("venv", r"\.venv", r"\.direnv", "tests", r"\.git", "setup.py"),
show_default=True,
)
@click.option(
Expand All @@ -128,7 +127,7 @@ def configure_logger(ctx: click.Context, _param: click.Parameter, value: bool) -
multiple=True,
help="""Like --exclude, but adds additional files and directories on top of the excluded ones instead of overwriting the defaults.
(Useful if you simply want to add to the default) `deptry . -ee ".*/foo/" -ee bar"`""",
default=DEFAULTS["extend_exclude"],
default=(),
show_default=True,
)
@click.option(
Expand All @@ -148,7 +147,7 @@ def configure_logger(ctx: click.Context, _param: click.Parameter, value: bool) -
type=COMMA_SEPARATED_TUPLE,
help=""".txt files to scan for dependencies. If a file called pyproject.toml with a [tool.poetry.dependencies] section is found, this argument is ignored
and the dependencies are extracted from the pyproject.toml file instead. Can be multiple e.g. `deptry . --requirements-txt req/prod.txt,req/extra.txt`""",
default=DEFAULTS["requirements_txt"],
default=("requirements.txt",),
show_default=True,
)
@click.option(
Expand All @@ -157,15 +156,14 @@ def configure_logger(ctx: click.Context, _param: click.Parameter, value: bool) -
type=COMMA_SEPARATED_TUPLE,
help=""".txt files to scan for additional development dependencies. If a file called pyproject.toml with a [tool.poetry.dependencies] section is found, this argument is ignored
and the dependencies are extracted from the pyproject.toml file instead. Can be multiple e.g. `deptry . --requirements-txt-dev req/dev.txt,req/test.txt`""",
default=DEFAULTS["requirements_txt_dev"],
default=("dev-requirements.txt", "requirements-dev.txt"),
show_default=True,
)
@click.option(
"--json-output",
"-o",
type=click.STRING,
help="""If specified, a summary of the dependency issues found will be written to the output location specified. e.g. `deptry . -o deptry.json`""",
default=DEFAULTS["json_output"],
show_default=True,
)
@click.option(
Expand Down
16 changes: 0 additions & 16 deletions deptry/cli_defaults.py

This file was deleted.

0 comments on commit 57a2e36

Please sign in to comment.