This project watches GitHub PRs in a Rust repo, analyzes the changes using Tree-sitter, and lists the affected functions in each .rs file.
- Connects to GitHub and gets all open PRs
- Clones the PR branch locally
- Computes diffs to find added/changed lines
- Parses changed Rust files and lists affected functions
- Python (brew install python)
- GitHub API (via PyGithub)
- Tree-sitter for Rust
# Clone tree-sitter-rust
cd rust_analyzer
git clone https://github.com/tree-sitter/tree-sitter-rust.git
cd ..
# Create venv and install deps
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# Build tree-sitter library
python rust_analyzer/tree_sitter_setup.py
# Set environment variables
export GITHUB_TOKEN=your_token
export REPO_NAME=yourrepo
export REPO_OWNER=yourusername
# Run it
python main.py