-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
602 add vulture #797
602 add vulture #797
Conversation
Thanks for this PR, @VFermat! @kgodey or @mathemancer would you care to review this? |
@seancolsen I'll take it, I've assigned myself. Thanks! |
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.
@VFermat This looks great, but the output doesn't show which file the dead code is in so it's hard to fix. See: https://github.com/centerofci/mathesar/runs/4142244656?check_suite_focus=true
This seems to be an issue with the action. I'm not sure that we need to use a GitHub action specific to Vulture, perhaps just running Vulture manually would work? e.g. see this example of a workflow where we run a Python script on the code. https://github.com/centerofci/mathesar-wiki/blob/master/.github/workflows/run-link-rot-detection.yml
@kgodey alright! I will test it as a workflow! |
@kgodey adding a reminder here! |
@VFermat sorry, I didn't realize this was ready for re-review, the usual practice is to request re-review via GitHub (step 7 here: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) |
@kgodey sorry for that! I don't think I have permission to alter the status of my pull requests tho... Can you check that for me please? |
@VFermat Can you click this button in the top right of the PR? |
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 don't see any output here when vulture
runs: https://github.com/centerofci/mathesar/runs/4230565151?check_suite_focus=true
Running vulture . --min-confidence 90
locally results in this:
/Users/kgodey/Code/mathesar/db/types/email.py:26: unused variable 'kw' (100% confidence)
/Users/kgodey/Code/mathesar/db/types/money.py:16: unused variable 'kw' (100% confidence)
/Users/kgodey/Code/mathesar/db/types/uri.py:45: unused variable 'kw' (100% confidence)
/Users/kgodey/Code/mathesar/mathesar/migrations/0012_transfer_database.py:6: unused variable 'schema_editor' (100% confidence)
/Users/kgodey/Code/mathesar/mathesar/migrations/0012_transfer_database.py:15: unused variable 'schema_editor' (100% confidence)
/Users/kgodey/Code/mathesar/mathesar/signals.py:9: unused variable 'sender' (100% confidence)
/Users/kgodey/Code/mathesar/mathesar/tests/api/test_schema_api.py:23: unused variable 'empty_nasa_table' (100% confidence)
/Users/kgodey/Code/mathesar/mathesar/tests/conftest.py:46: unused variable 'django_db_setup' (100% confidence)
/Users/kgodey/Code/mathesar/mathesar/tests/test_multi_db.py:71: unused variable 'multi_db_test_db' (100% confidence)
I don't see that on the action output.
@kgodey All the things found in your local run appear to be specifically excluded by the lines in |
This avoids clogging the pipeline, but still gives the output.
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.
@mathemancer I apparently didn't think to check the configuration, thanks for pointing that out.
I think we should exclude the things we don't intend to fix (including skipping the migrations
directories entirely) and remove the continue on error. The idea behind setting this up was to make sure we deleted unused code in PRs.
Closing this PR, since it's a bit tedious to work on the fork without permissions to that repo, so I'm creating a branch in this repo, and basing a new PR #965 off of that. @VFermat If you're out there, thank you very much for your work on this. @kgodey Please see the new PR for continued review / discussion. |
Fixes #602
Adds a GitHub action to run Vulture to Pushes and Pull Requests.
Vulture looks for unused code.
Technical details
Vulture gives confidence on the unused code found. For this action I went with 90%, as used on this action
Checklist
Update index.md
).master
branch of the repositoryvisible errors.
Developer Certificate of Origin
Developer Certificate of Origin
Vitor Eller