fpgmaas/deptry

Exclude files from `.gitignore`

mkniewallner opened this issue · 2 comments

Is your feature request related to a problem? Please describe.

Many git repositories include .gitignore files to avoid committing unwanted files to a git repository.

Most of the times, people also don't want linters/formatters to run on those files, as they are usually generated, or are not part of the application.

Describe the solution you would like

deptry could read entries from .gitignore, and automatically exclude the files, to avoid inspecting them.

Note that even if this could be a sensible default, people might still want to opt out from this behaviour.

As deptry has an extend_exclude parameter already, one solution could be to empty the default list of exclude, so that it relies on files in .gitignore by default instead, and fall back to strictly relying on this list (+ extend_exclude) without reading .gitignore in case exclude is populated by the user.

SOunds good to me! So, if I understand correctly, this is our desired behavior, right?

  • if exclude is set: use the values from exclude
  • if exclude and extend-exclude are set: use value from exclude and extend-exclude
  • if neither is set; use values from .gitignore
  • if only extend-exclude is set; use values from .gitignore and extend-exclude

SOunds good to me! So, if I understand correctly, this is our desired behavior, right?

* if `exclude` is set: use the values from `exclude`

* if `exclude` and `extend-exclude` are set: use value from `exclude` and `extend-exclude`

* if neither is set; use values from `.gitignore`

* if only `extend-exclude` is set; use values from `.gitignore` and `extend-exclude`

Exactly, yes.