fix: improve vulture scope#154
Conversation
8de592f to
4d572a4
Compare
|
To be honest I do not really understand how is this issue in the tests related to this PR. In my PC is failing |
4d572a4 to
fd2c5a3
Compare
lua/lint/linters/vulture.lua
Outdated
| stdin = false, | ||
| args = {}, | ||
| args = {"--exclude='/**/docs/*.py,/**/build/*.py'", function() | ||
| local output = vim.fn.system("git rev-parse --show-toplevel"):sub(1, -2) |
There was a problem hiding this comment.
Because the command retrieves a string with a special character at the end. This character, when used as input argument to vulture, ended up in the linter not properly working (basically there were no diagnostics). I verified that the current resulting string is the correct one by 1) comparing it (temporary if statement) with a hardcoded string of the expected path and 2) observing the same diagnostics were produced in the Vulture CLI and in Neovim
The failures were realted to upstream changes in neovim itself, see #155 |
Suggestions from the PR Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
The idea of this PR is to improve the scope of Vulture (dead code and unused variables analyzer). By default, the filename is passed as argument, which prevents the linter to analyze the full context of an entire repository. This leads to lots of false positives. The current implementation uses as input argument the git root directory if exists or the current dir otherwise. Tested both of them and works fine.
Fixes #153