Skip to content

Comments

pre-commit: move target directory from entry to args#1392

Open
GideonBear wants to merge 2 commits intofpgmaas:mainfrom
GideonBear:patch-1
Open

pre-commit: move target directory from entry to args#1392
GideonBear wants to merge 2 commits intofpgmaas:mainfrom
GideonBear:patch-1

Conversation

@GideonBear
Copy link

@GideonBear GideonBear commented Dec 14, 2025

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

Ref #840

Previously, running deptry in pre-commit when using a src directory:

  • with no args, results in DEP003 'mypackage' imported but it is a transitive dependency
  • with args: [ src ], results in double reports
  • with entry: deptry src, provides the correct behavior

However, entry is supposed to be an internal implementation detail, while args is meant for users to override. In this PR I've moved the directory to args so it can be overridden by args: [ "src" ] instead.

This is a breaking change, since anyone using args: [ "--something" ] will now be running deptry --something instead of deptry . --something, and need to edit their config to args: [ ".", "--something" ]. So feel free to deny if this isn't important enough to warrant that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant