Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python_file_finder): load gitignore from where CLI is invoked #380

Merged

Conversation

mkniewallner
Copy link
Collaborator

@mkniewallner mkniewallner commented May 9, 2023

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!
  • Documentation in docs is updated

Description of changes

.gitignore is currently looked for based on the root directory passed as a CLI argument. This means that developers using a src directory and invoking deptry with deptry src won't benefit from gitignore being loaded.

I don't think that there are a lot of use cases where .gitignore would be located in a different directory that the one deptry is launched from, so this PR updates the behaviour so that .gitignore is always loaded based on where deptry is invoked.

If there really is a need for explicitly configuring the path to .gitignore, we can think about adding an option later.

Note that this PR will also facilitate the implementation of #381, even if doesn't strictly requires it, since we could also loop over each directory passed through the CLI.

@mkniewallner mkniewallner marked this pull request as ready for review May 9, 2023 19:55
@mkniewallner mkniewallner requested a review from fpgmaas May 9, 2023 19:58
@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Merging #380 (fa3e44e) into main (18dad91) will not change coverage.
The diff coverage is 100.0%.

@@          Coverage Diff          @@
##            main    #380   +/-   ##
=====================================
  Coverage   96.0%   96.0%           
=====================================
  Files         37      37           
  Lines       1042    1042           
  Branches     207     207           
=====================================
  Hits        1001    1001           
  Misses        25      25           
  Partials      16      16           
Impacted Files Coverage Δ
deptry/python_file_finder.py 100.0% <100.0%> (ø)

@mkniewallner mkniewallner merged commit 640d45b into fpgmaas:main May 10, 2023
@mkniewallner mkniewallner deleted the fix/load-gitignore-from-current-path branch May 10, 2023 09:49
@mkniewallner mkniewallner added this to the 0.11 milestone May 10, 2023
@mkniewallner mkniewallner mentioned this pull request May 10, 2023
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.

2 participants