chore: integrate pre-push vulture dead-code scanner#1253
Open
seroperson wants to merge 1 commit into
Open
Conversation
10 tasks
4aa58b7 to
2b95ea6
Compare
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1252
Summary
vulture==2.16to dev deps and configured it inpyproject.toml.pathscovers production tree only (gittensor,neurons,scripts);tests/is omitted so test-only-API symbols (prod functions whose sole references live undertests/) surface as findings.gittensor/validator/issue_competitions/contract_client.py(on-chain shape) andgittensor/utils/mirror/models.py(das-github-mirror response shape).[tool.vulture] ignore_decorators(@click.command/@click.group/@*.command/@*.group) andignore_namesstages: [pre-push]in.pre-commit-config.yaml. CI already runsSKIP=pytest pre-commit run --all-files --hook-stage pre-push, so the existing lint job picks it up. Renamed the step from "Run pyright" to "Run pre-push checks (pyright, vulture)" for accuracy.Deletions surfaced by the scanner
gittensor/classes.py-FileChange.from_github_response,PullRequest.set_file_changes,PullRequest.current_labels,PullRequest.label_timeline_order, unusedDefaultDictimport.gittensor/utils/utils.py-parse_repo_name, unusedDictimport.gittensor/utils/github_api_tools.py-get_github_id, a 3-line wrapper aroundget_github_identity(token).github_id. Only the retry test called it; that test now exercisesget_github_identitydirectly and the retry coverage is preserved.gittensor/validator/utils/datetime_utils.py-parse_github_timestamp_to_cst,CHICAGO_TZ, unusedpytzimport. All call sites disappeared with refactor: strip legacy scoring pipeline; mirror-only master repos #1202's strip of the legacy GraphQL constructors.gittensor/validator/pat_storage.py-remove_pat. CRUD primitive with no prod caller; orphaned scaffolding for a deregister-cleanup path that was never wired up.TestRemovePat(3 tests) went with it.gittensor/validator/storage/repository.py-refresh_stale_pr_statesmethod, and theREFRESH_STALE_PR_STATESSQL constant inqueries.pyit consumed. The lone test reference was a defensivemock_repo.refresh_stale_pr_states.return_value = 0setup, not a real test.gittensor/constants.py-MAX_FILES_PER_GRAPHQL_BATCH.neurons/base/validator.py-self.lock = asyncio.Lock(). Bittensor-template carry-over; never had anasync withguard in this repo's history.tests/validator/conftest.py- gutted toPRBuilder.create()only (the lone fixture/importtest_pioneer_dividend.pyactually consumes).pr_factory/issue_factoryfixtures,IssueBuilderand itscompleted/transferred/not_planned/no_reasonmethods,MinerScenario, and all six miner-scenario fixtures - orphaned by refactor: strip legacy scoring pipeline; mirror-only master repos #1202.tests/cli/test_cli_helpers.py- removed dead_Sentinelguard +exec_was_calledplumbing intest_register_aborts_on_github_503_before_contract_call. The sentinel was defined but never patched into the test, so its "must not reach exec" assertion was vacuously true._-prefixed ingittensor/cli/issue_commands/helpers.py(_sign, _digits, exponent) and two test lambdas.Testing
Test plan
How it looks like