feat: migrate contexten package to graph_sitter#315
Conversation
- Move all files from src/contexten/ to src/graph_sitter/ - Update all import statements from 'contexten' to 'graph_sitter' - Update legacy 'codegen' imports to 'graph_sitter' - Update documentation references - Add dead code analysis script using graph_sitter's own capabilities - Package successfully installs and imports work correctly Analysis results: - 560 files processed - 26,416 nodes and 85,990 edges in codebase graph - 5,676 imports updated - 1,645 external modules - 1,593 symbols (612 classes, 464 functions, 517 global vars) - Identified 274 potentially unused functions and 168 unused classes for future cleanup
Reviewer's GuideThis PR completes the migration of the old Class diagram for dead code analysis script additionclassDiagram
class Codebase {
+functions
+classes
+files
}
class Function {
+name
+file
+symbol_usages
}
class Class {
+name
+file
+symbol_usages
}
class analyze_dead_code.py {
+main()
+get_codebase_summary()
+get_symbol_summary()
}
Codebase <|-- Function
Codebase <|-- Class
analyze_dead_code.py ..> Codebase : uses
analyze_dead_code.py ..> Function : analyzes
analyze_dead_code.py ..> Class : analyzes
Class diagram for final_review_gate.py script additionclassDiagram
class final_review_gate.py {
+main()
+interactive review loop
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…classes - Show complete list of all 464 functions with usage counts - Show complete list of all 612 classes with usage counts - Mark unused items with red indicators - Provide detailed summary of dead code analysis - Enhanced formatting for better readability
- Lists all 274 unused functions organized by file - Lists all 168 unused classes organized by file - Provides summary by file showing dead code hotspots - Identifies files with most cleanup opportunities - Ready-to-use for targeted code cleanup efforts
🚀 Migration: contexten → graph_sitter
This PR completes the migration of the
contextenpackage tograph_sitter, consolidating all functionality under a single, consistent package name.✅ Changes Made
📁 File Migration
src/contexten/tosrc/graph_sitter/contextendirectory structure🔄 Import Updates
contextentograph_sittercodegenimports tograph_sitter📊 Analysis Results
Using graph_sitter's own analysis capabilities:
🔍 Dead Code Analysis
analyze_dead_code.pyscript for ongoing maintenance✅ Verification
Package Installation
Import Testing
Functionality Testing
📋 Files Modified
Key areas updated:
src/graph_sitter/- All migrated files with updated importsexamples/- All example code updateddocs/- Documentation references updated🎯 Next Steps
This migration provides a clean foundation for:
The package is now fully consolidated under
graph_sitterwith all functionality preserved and working correctly.💻 View my work • About Codegen
Summary by Sourcery
Complete the migration of the contexten package to graph_sitter, consolidating files under the new namespace, updating imports across code, tests, and documentation, and adding a new dead-code analysis script for ongoing maintenance.
New Features:
Enhancements:
Documentation:
Tests:
Chores:
Description by Korbit AI
What change is being made?
Migrate the codebase from using the
contextenpackage to thegraph_sitterpackage by updating all import statements and related references throughout the project.Why are these changes being made?
This change updates the codebase to use the newer
graph_sitterpackage, which presumably offers equivalent or enhanced functionalities compared to the outdatedcontextenpackage. The migration involves altering imports across numerous files, ensuring compatibility and maintaining the integrity of the codebase while adopting the new package structure.