https://github.com/eswar2001/cada-rs
https://github.com/eswar2001/cada-rs
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eswar2001/cada-rs
- Owner: eswar2001
- Created: 2025-05-08T13:00:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-08T13:58:32.000Z (about 1 year ago)
- Last Synced: 2025-05-08T14:26:46.091Z (about 1 year ago)
- Language: Rust
- Size: 189 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
# Rust AST Differ
A tool for analyzing differences between Git commits at the abstract syntax tree (AST) level for Rust code. This tool is especially useful for understanding code changes in large Rust projects.
## Features
- Detects changes in functions, types, traits, and methods
- Produces detailed JSON reports of all code changes
- Provides granular analysis of function call changes
- Handles new, modified, and deleted files
- Tracks literals and function calls within changed functions
## Installation
### Prerequisites
- Rust and Cargo (install via [rustup](https://rustup.rs/))
- Git
### Building from source
```bash
# Clone the repository
git clone https://github.com/yourusername/rust-ast-differ.git
cd rust-ast-differ
# Build the tool
cargo build --release
# The binary will be in target/release/rust-ast-differ
```
## Usage
```bash
rust-ast-differ [outputPath]
```
### Parameters
- `repoUrl`: URL of the Git repository
- `localRepoPath`: Path where to clone/use the repository
- `branchName`: Base branch to compare against
- `currentCommit`: Target commit to analyze
- `outputPath` (optional): Directory to store output files (defaults to "./")
## Output Files
The tool generates several JSON files in the output directory:
- `all_code_changes.json`: All changes detected in the AST
- `function_changes.json`: Changes specific to functions
- `type_changes.json`: Changes specific to types (structs, enums, type aliases)
- `interface_changes.json`: Changes specific to traits (interfaces)
- `method_changes.json`: Changes specific to methods
- `function_changes_granular.json`: Detailed changes within functions (added/removed function calls and literals)
## License
This project is licensed under the MIT License - see the LICENSE file for details.