Skip to content

Commit

Permalink
Bugfix: Handle when .gitignore is not present. (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisDart authored Jan 1, 2024
1 parent aa6fcd2 commit 458be54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Switch to tomllib/tomli to support heterogeneous arrays (Sebastian Csar, #340).
* Provide whitelist parity for `MagicMock` and `Mock` (maxrake).
* Use .gitignore to exclude files if --exclude is missing from both pyproject.toml and the command line (whosayn, #344, #345).
* Properly detect when no .gitignore is present (travisdart, #346).

# 2.10 (2023-10-06)

Expand Down
2 changes: 1 addition & 1 deletion vulture/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _ignore_variable(filename, varname):


def _get_gitignore_pathspec():
if (gitignore := Path(".gitignore").resolve()).is_file:
if (gitignore := Path(".gitignore").resolve()).is_file():
with gitignore.open() as fh:
return PathSpec.from_lines("gitwildmatch", fh)
return PathSpec.from_lines("gitwildmatch", [])
Expand Down

0 comments on commit 458be54

Please sign in to comment.