diff --git a/CHANGELOG.md b/CHANGELOG.md index 28b0693b..e8177a30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/vulture/core.py b/vulture/core.py index b118aab3..39f85982 100644 --- a/vulture/core.py +++ b/vulture/core.py @@ -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", [])