I cloned the Vulture repo and created the dead_code.py file in the tests/ directory. I ran Vulture with: python ../vulture/__main__.py dead_code.py (maybe there's a more elegant way; I dunno), and I got this error:
$ python ../vulture/__main__.py dead_code.py
Traceback (most recent call last):
File "/Users/travis.dart/PycharmProjects/vulture/tests/../vulture/__main__.py", line 3, in <module>
main()
File "/Users/travis.dart/PycharmProjects/vulture/vulture/core.py", line 751, in main
vulture.scavenge(config["paths"], exclude=config["exclude"])
File "/Users/travis.dart/PycharmProjects/vulture/vulture/core.py", line 274, in scavenge
gitignore = _get_gitignore_pathspec()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/travis.dart/PycharmProjects/vulture/vulture/core.py", line 120, in _get_gitignore_pathspec
with gitignore.open() as fh:
^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py", line 1044, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/travis.dart/PycharmProjects/vulture/tests/.gitignore'
I found that there's an error in the function that detects the .gitignore file. Basically, we need is_file() instead of is_file.
I cloned the Vulture repo and created the
dead_code.py
file in thetests/
directory. I ran Vulture with:python ../vulture/__main__.py dead_code.py
(maybe there's a more elegant way; I dunno), and I got this error:I found that there's an error in the function that detects the
.gitignore
file. Basically, we needis_file()
instead ofis_file
.Checklist:
tox -e fix-style
to format my code and checked the result withtox -e style
.