-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Added Vulture dead code checker #5654
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
Conversation
| run: | | ||
| mypy | ||
| python-vulture: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been following the issue for which this PR has been raised and I wonder if it makes sense to have this as a separate workflow instead of adding it in the code formatting workflow.
Borda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it report any issue now?
|
@aniketmaurya thx for the quick PR, mind rebase it on feat 1.2 |
Codecov Report
@@ Coverage Diff @@
## master #5654 +/- ##
=======================================
- Coverage 93% 88% -5%
=======================================
Files 199 199
Lines 13008 13008
=======================================
- Hits 12044 11425 -619
- Misses 964 1583 +619 |
Hi @Borda, You mean in the GitHub actions? Yes, there are few dead code blocks detected by it. |
ok, soo it shall be fixed within the PR :] |
|
@aniketmaurya fixed :] can you fix the code so the check pass :] |
Thank you @Borda |
|
Hi @RJ722, mind review the vulture workflow CI here? |
Done @edenlightning ! |
|
I'm not sure we should integrate this checker into Lightning, considering we have a lot of dynamism in the way we call hooks so this checker will often produce false positives. The number of items you already had to whitelist makes me think this is not that useful for this project. |
Co-authored-by: Rahul Jha <[email protected]>
for more information, see https://pre-commit.ci
|
I agree with @carmocca, seems there are a lot of false positives (and a long whitelist) so I'm not sure there is much benefit to adding this. |
|
I do not have any preference on used tool, but still thinking that we shall address dead code in our codebase... |
…tning into aniketmaurya/master
| self._handles[module_name] = [pre_forward_handle, post_forward_handle] | ||
|
|
||
| def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: | ||
| def __exit__(self, type: Any, value: Any, traceback: Any) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type is a built-in keyword.
better to avoid name clash here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vulture picks up exc_type because it doesn't match the parent signature. We have a few options:
- leave like this, matches the parent
- convert to
_,__,___- standard for unused variables - add to whitelist (already a bit big)
What does this PR do?
Resolves #5649
I have integrated Vulture to CI for dead code checking.
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃