diff --git a/deptry/cli_defaults.py b/deptry/cli_defaults.py index 6a789b5e..335a3b5f 100644 --- a/deptry/cli_defaults.py +++ b/deptry/cli_defaults.py @@ -3,7 +3,7 @@ "ignore_missing": (), "ignore_transitive": (), "ignore_misplaced_dev": (), - "exclude": ("venv", r"\.venv", "tests", r"\.git", "setup.py"), + "exclude": ("venv", r"\.venv", r"\.direnv", "tests", r"\.git", "setup.py"), "extend_exclude": (), "ignore_notebooks": False, "skip_obsolete": False, diff --git a/deptry/result_logger.py b/deptry/result_logger.py index af92ecb4..e27c3fc7 100644 --- a/deptry/result_logger.py +++ b/deptry/result_logger.py @@ -75,16 +75,17 @@ def _log_additional_info(self) -> None: ``` [tool.deptry] ignore_obsolete = [ - 'foo' + "foo" ] ignore_missing = [ - 'bar' + "bar" ] ignore_transitive = [ - 'baz' + "baz" ] - exclude = [ - 'venv','.venv', 'tests', 'setup.py', 'docs' + extend_exclude = [ + ".*/foo/", + "bar/baz.py" ] ``` diff --git a/docs/pyproject-toml.md b/docs/pyproject-toml.md index c29c7a82..12101e1d 100644 --- a/docs/pyproject-toml.md +++ b/docs/pyproject-toml.md @@ -24,13 +24,9 @@ An example of a configuration section for _deptry_ is given below. ```toml [tool.deptry] -exclude = [ - "venv", - ".venv", - "tests", - "setup.py", - "docs", +extend_exclude = [ ".*/foo/", + "bar/baz.py" ] ignore_obsolete = [ "alpha", diff --git a/docs/usage.md b/docs/usage.md index d0ece001..21f97538 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -38,7 +38,7 @@ _deptry_ can also be configured to look for `requirements.txt` files with other To determine issues with imported modules and dependencies, _deptry_ will scan the working directory and its subdirectories recursively for `.py` and `.ipynb` files, so it can extract the imported modules from those files. Any files solely used for development purposes, such as files used for unit testing, should not be scanned. By default, the directories -`venv`, `.venv`, `tests`, `.git` and the file `setup.py` are excluded. +`venv`, `.venv`, `.direnv`, `tests`, `.git` and the file `setup.py` are excluded. To ignore other directories and files than the defaults, use the `--exclude` (or `-e`) flag. The argument can either be one long regular expression, or it can be reused multiple times to pass multiple smaller regular expressions. The paths should be specified as paths relative to the directory _deptry_ is running in, without the trailing `./`. An example: @@ -57,7 +57,7 @@ deptry . -ee bar -ee ".*/foo/" deptry . --extend-exclude "bar|.*/foo/" ``` -This will exclude `venv`, `.venv`, `.git`, `tests`, `setup.py`, `bar`, and any directory named `foo`. +This will exclude `venv`, `.venv`, `.direnv`, `.git`, `tests`, `setup.py`, `bar`, and any directory named `foo`. ## Increased verbosity