Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/dead-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Dead code
# Managed by CodexSkills bootstrap-code-quality.py
on:
pull_request:
permissions:
contents: read
jobs:
dead-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
- run: bash scripts/check-dead-code.sh
env:
QUALITY_BASE_REF: origin/${{ github.base_ref }}
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


## Code cleanup

- Run `bash scripts/check-dead-code.sh` after removing code and before review.
- For cross-file changes, run `graphify update .`, inspect callers and dependencies, and verify findings in current source and framework registrations.
6 changes: 2 additions & 4 deletions neural/data_collection/espn_enhanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,7 @@ def _calculate_momentum_score(self, play: dict[str, Any]) -> tuple[float, Moment

return final_score, direction

def _process_play(
self, play: dict[str, Any], drive_info: dict[str, Any] | None = None
) -> PlayData:
def _process_play(self, play: dict[str, Any]) -> PlayData:
"""Process raw play data into structured format."""
play_id = play.get("id", str(play.get("sequenceNumber", 0)))
description = play.get("text", "")
Expand Down Expand Up @@ -364,7 +362,7 @@ async def collect(self) -> AsyncGenerator[dict[str, Any], None]:

# Only process new plays
if self.last_play_id is None or play_id != self.last_play_id:
processed_play = self._process_play(play, drive)
processed_play = self._process_play(play)
new_plays.append(processed_play)
all_plays.append(processed_play)

Expand Down
5 changes: 5 additions & 0 deletions quality/vulture-whitelist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Vulture whitelist for callback arguments required by external protocols."""

def _required_callback_parameters(signum, exc_type, exc_val, exc_tb, tb):
"""Keep names required by signal and context-manager protocols."""
return signum, exc_type, exc_val, exc_tb, tb
7 changes: 7 additions & 0 deletions scripts/check-dead-code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Managed by CodexSkills bootstrap-code-quality.py
set -euo pipefail
cd "$(dirname "$0")/.."
py_files=()
while IFS= read -r -d '' file; do py_files+=("$file"); done < <(git ls-files --cached --others --exclude-standard -z -- '*.py')
if ((${#py_files[@]})); then uvx --from vulture==2.16 vulture "${py_files[@]}" --min-confidence 90; fi
Loading