tree-sitter-analyzer 0.9.4__tar.gz → 0.9.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tree-sitter-analyzer might be problematic. Click here for more details.
- tree_sitter_analyzer-0.9.6/.kiro/steering/product.md +32 -0
- tree_sitter_analyzer-0.9.6/.kiro/steering/structure.md +197 -0
- tree_sitter_analyzer-0.9.6/.kiro/steering/tech.md +150 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/.pre-commit-config.yaml +23 -1
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/CHANGELOG.md +196 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/CONTRIBUTING.md +48 -2
- tree_sitter_analyzer-0.9.6/DEPLOYMENT_GUIDE.md +207 -0
- tree_sitter_analyzer-0.9.6/LANGUAGE_GUIDELINES.md +160 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/MCP_SETUP_USERS.md +2 -2
- tree_sitter_analyzer-0.9.6/PKG-INFO +631 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/PYPI_RELEASE_GUIDE.md +14 -14
- tree_sitter_analyzer-0.9.6/README.md +496 -0
- tree_sitter_analyzer-0.9.6/README_ja.md +496 -0
- tree_sitter_analyzer-0.9.6/README_zh.md +497 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/docs/api.md +3 -3
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/pyproject.toml +1 -1
- tree_sitter_analyzer-0.9.6/scripts/improved_readme_updater.py +470 -0
- tree_sitter_analyzer-0.9.6/scripts/readme_config.py +133 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/start_mcp_server.py +8 -2
- tree_sitter_analyzer-0.9.6/training/01_onboarding.md +152 -0
- tree_sitter_analyzer-0.9.6/training/02_architecture_map.md +93 -0
- tree_sitter_analyzer-0.9.6/training/03_cli_cheatsheet.md +58 -0
- tree_sitter_analyzer-0.9.6/training/04_mcp_cheatsheet.md +73 -0
- tree_sitter_analyzer-0.9.6/training/05_plugin_tutorial.md +67 -0
- tree_sitter_analyzer-0.9.6/training/06_quality_workflow.md +41 -0
- tree_sitter_analyzer-0.9.6/training/07_troubleshooting.md +39 -0
- tree_sitter_analyzer-0.9.6/training/08_prompt_library.md +62 -0
- tree_sitter_analyzer-0.9.6/training/09_tasks.md +31 -0
- tree_sitter_analyzer-0.9.6/training/10_glossary.md +14 -0
- tree_sitter_analyzer-0.9.6/training/11_takeover_plan.md +53 -0
- tree_sitter_analyzer-0.9.6/training/README.md +39 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/__init__.py +1 -1
- tree_sitter_analyzer-0.9.6/tree_sitter_analyzer/cli/commands/query_command.py +107 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli_main.py +21 -0
- tree_sitter_analyzer-0.9.6/tree_sitter_analyzer/core/query_filter.py +200 -0
- tree_sitter_analyzer-0.9.6/tree_sitter_analyzer/core/query_service.py +162 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/encoding_utils.py +7 -4
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/resources/code_file_resource.py +1 -2
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/server.py +7 -1
- tree_sitter_analyzer-0.9.6/tree_sitter_analyzer/mcp/tools/query_tool.py +238 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/queries/java.py +5 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/security/boundary_manager.py +10 -2
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/table_formatter.py +6 -1
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/utils.py +51 -40
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/uv.lock +1 -1
- tree_sitter_analyzer-0.9.4/DEPLOYMENT_GUIDE.md +0 -278
- tree_sitter_analyzer-0.9.4/PKG-INFO +0 -409
- tree_sitter_analyzer-0.9.4/README.md +0 -274
- tree_sitter_analyzer-0.9.4/README_ja.md +0 -255
- tree_sitter_analyzer-0.9.4/README_zh.md +0 -269
- tree_sitter_analyzer-0.9.4/UPLOAD_COMMANDS.md +0 -90
- tree_sitter_analyzer-0.9.4/tree_sitter_analyzer/cli/commands/query_command.py +0 -92
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/.gitignore +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/AI_COLLABORATION_GUIDE.md +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/CODE_STYLE_GUIDE.md +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/LLM_CODING_GUIDELINES.md +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/MCP_SETUP_DEVELOPERS.md +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/PROJECT_ROOT_CONFIG.md +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/build_standalone.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/check_quality.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/BigService.java +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/BigService.json +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/BigService.summary.json +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/JavaDocTest.java +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/MultiClass.java +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/Sample.java +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/calculate_token_comparison.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/project_root_demo.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/sample.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/security_demo.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/examples/security_integration_demo.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/llm_code_checker.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/pypirc_example.txt +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/pytest.ini +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/__main__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/api.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/__main__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/commands/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/commands/advanced_command.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/commands/base_command.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/commands/default_command.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/commands/partial_read_command.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/commands/structure_command.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/commands/summary_command.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/commands/table_command.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/cli/info_commands.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/core/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/core/analysis_engine.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/core/cache_service.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/core/engine.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/core/parser.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/core/query.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/exceptions.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/file_handler.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/formatters/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/formatters/base_formatter.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/formatters/formatter_factory.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/formatters/java_formatter.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/formatters/python_formatter.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/interfaces/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/interfaces/cli.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/interfaces/cli_adapter.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/interfaces/mcp_adapter.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/interfaces/mcp_server.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/language_detector.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/language_loader.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/languages/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/languages/java_plugin.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/languages/javascript_plugin.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/languages/python_plugin.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/resources/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/resources/project_stats_resource.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/tools/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/tools/base_tool.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/tools/read_partial_tool.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/tools/table_format_tool.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/utils/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/mcp/utils/error_handler.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/models.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/output_manager.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/plugins/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/plugins/base.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/plugins/manager.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/project_detector.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/queries/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/queries/javascript.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/queries/python.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/queries/typescript.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/query_loader.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/security/__init__.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/security/regex_checker.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/tree_sitter_analyzer/security/validator.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/upload_interactive.py +0 -0
- {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.6}/upload_to_pypi.py +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Product Overview
|
|
2
|
+
|
|
3
|
+
## What is Tree-sitter Analyzer?
|
|
4
|
+
|
|
5
|
+
Tree-sitter Analyzer is a revolutionary code analysis tool designed specifically for the AI era. It solves the fundamental problem of LLM token limits when analyzing large code files.
|
|
6
|
+
|
|
7
|
+
## Core Value Proposition
|
|
8
|
+
|
|
9
|
+
**Problem**: Large code files (>10K lines) exceed LLM token limits, making AI-assisted code analysis impossible or inefficient.
|
|
10
|
+
|
|
11
|
+
**Solution**: Smart code analysis that provides:
|
|
12
|
+
- Code structure overview without reading entire files
|
|
13
|
+
- Precise line-range extraction of code sections
|
|
14
|
+
- Accurate positioning data for code operations
|
|
15
|
+
- Native AI assistant integration via MCP protocol
|
|
16
|
+
|
|
17
|
+
## Target Users
|
|
18
|
+
|
|
19
|
+
1. **AI Assistant Users**: Developers using Claude Desktop, Cursor, Roo Code, and other AI IDEs
|
|
20
|
+
2. **CLI Users**: Developers who prefer command-line tools for code analysis
|
|
21
|
+
3. **Enterprise Teams**: Organizations dealing with large codebases and AI-assisted development
|
|
22
|
+
|
|
23
|
+
## Key Features
|
|
24
|
+
|
|
25
|
+
- **Multi-language Support**: Java, Python, JavaScript/TypeScript (full), C/C++/Rust/Go (basic)
|
|
26
|
+
- **Three-step Workflow**: Scale check → Structure analysis → Code extraction
|
|
27
|
+
- **MCP Integration**: Native support for Model Context Protocol
|
|
28
|
+
- **Enterprise Quality**: 1,358 tests, 74.54% coverage, cross-platform compatibility
|
|
29
|
+
|
|
30
|
+
## Current Version
|
|
31
|
+
|
|
32
|
+
v0.9.4 - Latest stable release with comprehensive MCP support and enhanced security features.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Project Structure & Organization
|
|
2
|
+
|
|
3
|
+
## Root Directory Layout
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
tree-sitter-analyzer/
|
|
7
|
+
├── .git/ # Git repository
|
|
8
|
+
├── .github/ # GitHub workflows and templates
|
|
9
|
+
├── .kiro/ # Kiro IDE configuration and steering
|
|
10
|
+
├── tree_sitter_analyzer/ # Main package source code
|
|
11
|
+
├── tests/ # Comprehensive test suite
|
|
12
|
+
├── examples/ # Sample files for testing and demos
|
|
13
|
+
├── docs/ # Documentation
|
|
14
|
+
├── dist/ # Build artifacts (generated)
|
|
15
|
+
├── .venv/ # Virtual environment (generated)
|
|
16
|
+
└── Configuration files (see below)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Core Package Structure (`tree_sitter_analyzer/`)
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
tree_sitter_analyzer/
|
|
23
|
+
├── __init__.py # Package initialization
|
|
24
|
+
├── __main__.py # Module entry point
|
|
25
|
+
├── api.py # Public API interface
|
|
26
|
+
├── cli_main.py # CLI entry point
|
|
27
|
+
├── models.py # Data models and types
|
|
28
|
+
├── utils.py # Utility functions
|
|
29
|
+
├── exceptions.py # Custom exception classes
|
|
30
|
+
├── encoding_utils.py # File encoding utilities
|
|
31
|
+
├── file_handler.py # File operations
|
|
32
|
+
├── language_detector.py # Language detection logic
|
|
33
|
+
├── language_loader.py # Tree-sitter language loading
|
|
34
|
+
├── output_manager.py # Output formatting and display
|
|
35
|
+
├── project_detector.py # Project root detection
|
|
36
|
+
├── query_loader.py # Query management
|
|
37
|
+
├── table_formatter.py # Table output formatting
|
|
38
|
+
├── core/ # Core analysis engine
|
|
39
|
+
├── cli/ # CLI command implementations
|
|
40
|
+
├── formatters/ # Output formatters
|
|
41
|
+
├── interfaces/ # Interface adapters (CLI, MCP)
|
|
42
|
+
├── languages/ # Language-specific plugins
|
|
43
|
+
├── mcp/ # MCP server implementation
|
|
44
|
+
├── plugins/ # Plugin system
|
|
45
|
+
├── queries/ # Tree-sitter queries
|
|
46
|
+
├── security/ # Security validation
|
|
47
|
+
└── validation/ # Input validation
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Key Subdirectories
|
|
51
|
+
|
|
52
|
+
### `core/` - Analysis Engine
|
|
53
|
+
- `analysis_engine.py` - Main analysis orchestration
|
|
54
|
+
- `query_engine.py` - Query execution engine
|
|
55
|
+
- Core business logic for code analysis
|
|
56
|
+
|
|
57
|
+
### `cli/` - Command Line Interface
|
|
58
|
+
- `commands.py` - CLI command implementations
|
|
59
|
+
- `parser.py` - Argument parsing
|
|
60
|
+
- Command-line specific logic
|
|
61
|
+
|
|
62
|
+
### `languages/` - Language Plugins
|
|
63
|
+
- `java_plugin.py` - Java language support
|
|
64
|
+
- `python_plugin.py` - Python language support
|
|
65
|
+
- `javascript_plugin.py` - JavaScript language support
|
|
66
|
+
- Language-specific analysis logic
|
|
67
|
+
|
|
68
|
+
### `mcp/` - Model Context Protocol
|
|
69
|
+
- `server.py` - MCP server implementation
|
|
70
|
+
- `tools.py` - MCP tool definitions
|
|
71
|
+
- AI assistant integration
|
|
72
|
+
|
|
73
|
+
### `security/` - Security Framework
|
|
74
|
+
- `boundary_manager.py` - Project boundary validation
|
|
75
|
+
- `validator.py` - Input validation and sanitization
|
|
76
|
+
- `regex_checker.py` - Safe regex pattern validation
|
|
77
|
+
|
|
78
|
+
## Test Structure (`tests/`)
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
tests/
|
|
82
|
+
├── conftest.py # Pytest configuration and fixtures
|
|
83
|
+
├── test_*.py # Unit tests (main level)
|
|
84
|
+
├── test_core/ # Core engine tests
|
|
85
|
+
├── test_interfaces/ # Interface adapter tests
|
|
86
|
+
├── test_languages/ # Language plugin tests
|
|
87
|
+
├── test_mcp/ # MCP server tests
|
|
88
|
+
├── test_plugins/ # Plugin system tests
|
|
89
|
+
├── test_security/ # Security framework tests
|
|
90
|
+
└── __pycache__/ # Compiled test files (generated)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Configuration Files
|
|
94
|
+
|
|
95
|
+
### Package Configuration
|
|
96
|
+
- `pyproject.toml` - Main package configuration, dependencies, build settings
|
|
97
|
+
- `uv.lock` - Dependency lock file
|
|
98
|
+
- `pytest.ini` - Test configuration
|
|
99
|
+
|
|
100
|
+
### Code Quality
|
|
101
|
+
- `.pre-commit-config.yaml` - Pre-commit hooks configuration
|
|
102
|
+
- Quality tools configured in `pyproject.toml`
|
|
103
|
+
|
|
104
|
+
### Documentation
|
|
105
|
+
- `README.md` - Main documentation (English)
|
|
106
|
+
- `README_zh.md` - Chinese documentation
|
|
107
|
+
- `README_ja.md` - Japanese documentation
|
|
108
|
+
- `CONTRIBUTING.md` - Contribution guidelines
|
|
109
|
+
- `CODE_STYLE_GUIDE.md` - Code style standards
|
|
110
|
+
- `CHANGELOG.md` - Version history
|
|
111
|
+
|
|
112
|
+
### Deployment & Release
|
|
113
|
+
- `DEPLOYMENT_GUIDE.md` - Deployment instructions
|
|
114
|
+
- `PYPI_RELEASE_GUIDE.md` - PyPI release process
|
|
115
|
+
- `upload_to_pypi.py` - Release automation script
|
|
116
|
+
- `build_standalone.py` - Standalone build script
|
|
117
|
+
|
|
118
|
+
## Examples Directory (`examples/`)
|
|
119
|
+
|
|
120
|
+
- `BigService.java` - Large Java service class (1419 lines, 66 methods) - main demo file
|
|
121
|
+
- `Sample.java` - Smaller Java example (178 lines, 8 classes)
|
|
122
|
+
- `MultiClass.java` - Multi-class Java example
|
|
123
|
+
- `sample.py` - Python example
|
|
124
|
+
- `*.json` - Analysis result examples
|
|
125
|
+
- Demo and testing files for various languages
|
|
126
|
+
|
|
127
|
+
## Naming Conventions
|
|
128
|
+
|
|
129
|
+
### Files and Directories
|
|
130
|
+
- **Snake case** for Python files: `analysis_engine.py`
|
|
131
|
+
- **Lowercase** for directories: `tree_sitter_analyzer/`
|
|
132
|
+
- **Descriptive names** that indicate purpose
|
|
133
|
+
|
|
134
|
+
### Code Organization
|
|
135
|
+
- **One class per file** when possible
|
|
136
|
+
- **Logical grouping** by functionality
|
|
137
|
+
- **Clear separation** between interfaces, core logic, and plugins
|
|
138
|
+
|
|
139
|
+
### Import Structure
|
|
140
|
+
```python
|
|
141
|
+
# Standard library imports
|
|
142
|
+
import os
|
|
143
|
+
from pathlib import Path
|
|
144
|
+
|
|
145
|
+
# Third-party imports
|
|
146
|
+
import tree_sitter
|
|
147
|
+
from typing import Dict, List
|
|
148
|
+
|
|
149
|
+
# Local imports
|
|
150
|
+
from .models import AnalysisResult
|
|
151
|
+
from .utils import log_info
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Plugin Architecture
|
|
155
|
+
|
|
156
|
+
### Language Plugins
|
|
157
|
+
- Each language has its own plugin file
|
|
158
|
+
- Plugins implement common interface
|
|
159
|
+
- Dynamic loading and registration
|
|
160
|
+
- Extensible for new languages
|
|
161
|
+
|
|
162
|
+
### Entry Points
|
|
163
|
+
- Defined in `pyproject.toml`
|
|
164
|
+
- Automatic plugin discovery
|
|
165
|
+
- Support for external plugins
|
|
166
|
+
|
|
167
|
+
## Security Boundaries
|
|
168
|
+
|
|
169
|
+
### Project Root Detection
|
|
170
|
+
- Automatic detection from `.git`, `pyproject.toml`, etc.
|
|
171
|
+
- Configurable via CLI `--project-root`
|
|
172
|
+
- Environment variable `TREE_SITTER_PROJECT_ROOT`
|
|
173
|
+
|
|
174
|
+
### File Access Control
|
|
175
|
+
- All file operations validated against project boundaries
|
|
176
|
+
- Path traversal attack prevention
|
|
177
|
+
- Symlink safety checks
|
|
178
|
+
|
|
179
|
+
## Build Artifacts (Generated)
|
|
180
|
+
|
|
181
|
+
### Distribution
|
|
182
|
+
- `dist/` - Wheel and source distributions
|
|
183
|
+
- Built via `uv build`
|
|
184
|
+
|
|
185
|
+
### Cache Directories
|
|
186
|
+
- `.mypy_cache/` - MyPy type checking cache
|
|
187
|
+
- `.pytest_cache/` - Pytest execution cache
|
|
188
|
+
- `.ruff_cache/` - Ruff linting cache
|
|
189
|
+
- `__pycache__/` - Python bytecode cache
|
|
190
|
+
|
|
191
|
+
## Development Workflow
|
|
192
|
+
|
|
193
|
+
1. **Setup**: `uv sync --extra all --extra mcp`
|
|
194
|
+
2. **Code**: Follow structure and naming conventions
|
|
195
|
+
3. **Test**: Add tests in appropriate `test_*/` directories
|
|
196
|
+
4. **Quality**: Run `uv run python check_quality.py --new-code-only --fix`
|
|
197
|
+
5. **Commit**: Pre-commit hooks ensure quality
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Technology Stack & Build System
|
|
2
|
+
|
|
3
|
+
## Build System & Package Management
|
|
4
|
+
|
|
5
|
+
- **Primary**: `uv` (fast Python package manager) - used for all development and user installations
|
|
6
|
+
- **Build Backend**: `hatchling` (modern Python build system)
|
|
7
|
+
- **Package Distribution**: PyPI with multiple installation options
|
|
8
|
+
|
|
9
|
+
## Core Technology Stack
|
|
10
|
+
|
|
11
|
+
### Language & Runtime
|
|
12
|
+
- **Python**: 3.10+ (required minimum)
|
|
13
|
+
- **Tree-sitter**: v0.24.0 (core parsing engine)
|
|
14
|
+
- **Async Support**: `asyncio` for MCP server operations
|
|
15
|
+
|
|
16
|
+
### Key Dependencies
|
|
17
|
+
- **MCP**: v1.12.3+ (Model Context Protocol for AI integration)
|
|
18
|
+
- **Character Detection**: `chardet` v5.0.0+ (encoding detection)
|
|
19
|
+
- **Caching**: `cachetools` v5.0.0+ (performance optimization)
|
|
20
|
+
|
|
21
|
+
### Language Parsers
|
|
22
|
+
- `tree-sitter-java` v0.23.5+
|
|
23
|
+
- `tree-sitter-python` v0.23.6+
|
|
24
|
+
- `tree-sitter-javascript` v0.23.1+
|
|
25
|
+
- `tree-sitter-typescript` v0.20.0+
|
|
26
|
+
- `tree-sitter-cpp` v0.23.4+
|
|
27
|
+
- Additional parsers for C, Rust, Go
|
|
28
|
+
|
|
29
|
+
## Development Tools
|
|
30
|
+
|
|
31
|
+
### Code Quality
|
|
32
|
+
- **Formatter**: Black (88 character line length)
|
|
33
|
+
- **Linter**: Ruff (fast Python linter)
|
|
34
|
+
- **Type Checker**: MyPy (with strict configuration)
|
|
35
|
+
- **Import Sorting**: isort (Black-compatible)
|
|
36
|
+
|
|
37
|
+
### Testing Framework
|
|
38
|
+
- **Test Runner**: pytest v8.4.1+
|
|
39
|
+
- **Coverage**: pytest-cov v4.0.0+
|
|
40
|
+
- **Async Testing**: pytest-asyncio v1.1.0+
|
|
41
|
+
- **Mocking**: pytest-mock v3.14.1+
|
|
42
|
+
|
|
43
|
+
### Pre-commit Hooks
|
|
44
|
+
- **Setup**: `pre-commit` v3.0.0+
|
|
45
|
+
- **Hooks**: Black, Ruff, MyPy integration
|
|
46
|
+
|
|
47
|
+
## Common Commands
|
|
48
|
+
|
|
49
|
+
### Development Setup
|
|
50
|
+
```bash
|
|
51
|
+
# Clone and setup development environment
|
|
52
|
+
git clone https://github.com/aimasteracc/tree-sitter-analyzer.git
|
|
53
|
+
cd tree-sitter-analyzer
|
|
54
|
+
uv sync --extra all --extra mcp
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Testing
|
|
58
|
+
```bash
|
|
59
|
+
# Run all tests (1,358 tests)
|
|
60
|
+
uv run pytest tests/ -v
|
|
61
|
+
|
|
62
|
+
# Run with coverage report
|
|
63
|
+
uv run pytest tests/ --cov=tree_sitter_analyzer --cov-report=html
|
|
64
|
+
|
|
65
|
+
# Run specific test categories
|
|
66
|
+
uv run pytest tests/test_mcp_server_initialization.py -v
|
|
67
|
+
uv run pytest tests/test_formatters_comprehensive.py -v
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Code Quality Checks
|
|
71
|
+
```bash
|
|
72
|
+
# Format code
|
|
73
|
+
uv run black .
|
|
74
|
+
|
|
75
|
+
# Check formatting
|
|
76
|
+
uv run black --check .
|
|
77
|
+
|
|
78
|
+
# Lint code
|
|
79
|
+
uv run ruff check .
|
|
80
|
+
|
|
81
|
+
# Auto-fix safe issues
|
|
82
|
+
uv run ruff check . --fix
|
|
83
|
+
|
|
84
|
+
# Type checking
|
|
85
|
+
uv run mypy .
|
|
86
|
+
|
|
87
|
+
# Run all quality checks
|
|
88
|
+
uv run python check_quality.py
|
|
89
|
+
|
|
90
|
+
# Auto-fix and check (recommended for new contributors)
|
|
91
|
+
uv run python check_quality.py --new-code-only --fix
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Building & Distribution
|
|
95
|
+
```bash
|
|
96
|
+
# Build package
|
|
97
|
+
uv build
|
|
98
|
+
|
|
99
|
+
# Upload to PyPI (maintainers only)
|
|
100
|
+
uv run python upload_to_pypi.py
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### CLI Usage
|
|
104
|
+
```bash
|
|
105
|
+
# Basic analysis (large file demo)
|
|
106
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --advanced --output-format=text
|
|
107
|
+
|
|
108
|
+
# Structure analysis (66 methods clearly displayed)
|
|
109
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --table=full
|
|
110
|
+
|
|
111
|
+
# Partial reading (extract specific code section)
|
|
112
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --partial-read --start-line 100 --end-line 105
|
|
113
|
+
|
|
114
|
+
# Quiet mode
|
|
115
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --table=full --quiet
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### MCP Server
|
|
119
|
+
```bash
|
|
120
|
+
# Start MCP server (development)
|
|
121
|
+
uv run python -m tree_sitter_analyzer.mcp.server
|
|
122
|
+
|
|
123
|
+
# Start with project root
|
|
124
|
+
TREE_SITTER_PROJECT_ROOT=/path/to/project uv run python -m tree_sitter_analyzer.mcp.server
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Installation Options
|
|
128
|
+
|
|
129
|
+
### End Users
|
|
130
|
+
```bash
|
|
131
|
+
# Basic installation
|
|
132
|
+
uv add tree-sitter-analyzer
|
|
133
|
+
|
|
134
|
+
# Popular languages (Java, Python, JS, TS)
|
|
135
|
+
uv add "tree-sitter-analyzer[popular]"
|
|
136
|
+
|
|
137
|
+
# With MCP server support
|
|
138
|
+
uv add "tree-sitter-analyzer[mcp]"
|
|
139
|
+
|
|
140
|
+
# Full installation
|
|
141
|
+
uv add "tree-sitter-analyzer[all,mcp]"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Architecture Notes
|
|
145
|
+
|
|
146
|
+
- **Plugin System**: Dynamic plugin architecture for language support
|
|
147
|
+
- **Caching**: Multi-level caching for parsers and analysis results
|
|
148
|
+
- **Security**: Project boundary validation and input sanitization
|
|
149
|
+
- **Performance**: Optimized for large file handling with minimal memory usage
|
|
150
|
+
- **Cross-platform**: Windows, macOS, Linux compatibility
|
|
@@ -80,11 +80,33 @@ repos:
|
|
|
80
80
|
hooks:
|
|
81
81
|
- id: quality-check
|
|
82
82
|
name: Tree-sitter Analyzer Quality Check
|
|
83
|
-
entry: python check_quality.py --new-code-only
|
|
83
|
+
entry: uv run python check_quality.py --new-code-only
|
|
84
84
|
language: system
|
|
85
85
|
pass_filenames: false
|
|
86
86
|
stages: [pre-push] # Only run on push
|
|
87
87
|
|
|
88
|
+
# README stats update (improved version)
|
|
89
|
+
- repo: local
|
|
90
|
+
hooks:
|
|
91
|
+
- id: update-readme-stats
|
|
92
|
+
name: Update README Statistics
|
|
93
|
+
entry: uv run python scripts/improved_readme_updater.py
|
|
94
|
+
language: system
|
|
95
|
+
pass_filenames: false
|
|
96
|
+
stages: [pre-push] # Only run on push
|
|
97
|
+
files: ^(README.*\.md|pyproject\.toml|examples/.*\.java)$
|
|
98
|
+
|
|
99
|
+
# README stats validation
|
|
100
|
+
- repo: local
|
|
101
|
+
hooks:
|
|
102
|
+
- id: validate-readme-stats
|
|
103
|
+
name: Validate README Statistics
|
|
104
|
+
entry: uv run python scripts/improved_readme_updater.py --validate-only
|
|
105
|
+
language: system
|
|
106
|
+
pass_filenames: false
|
|
107
|
+
stages: [pre-commit] # Run on every commit
|
|
108
|
+
files: ^README.*\.md$
|
|
109
|
+
|
|
88
110
|
# Configuration
|
|
89
111
|
default_stages: [pre-commit]
|
|
90
112
|
fail_fast: false
|
|
@@ -1,4 +1,200 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [0.9.6] - 2025-01-17
|
|
3
|
+
|
|
4
|
+
### 🎉 New Feature: Advanced Query Filtering System
|
|
5
|
+
|
|
6
|
+
#### 🚀 Major Features
|
|
7
|
+
|
|
8
|
+
##### Smart Query Filtering
|
|
9
|
+
- **Precise Method Search**: Find specific methods using `--filter "name=main"`
|
|
10
|
+
- **Pattern Matching**: Use wildcards like `--filter "name=~auth*"` for authentication-related methods
|
|
11
|
+
- **Parameter Filtering**: Filter by parameter count with `--filter "params=0"`
|
|
12
|
+
- **Modifier Filtering**: Search by visibility and modifiers like `--filter "static=true,public=true"`
|
|
13
|
+
- **Compound Conditions**: Combine multiple filters with `--filter "name=~get*,params=0,public=true"`
|
|
14
|
+
|
|
15
|
+
##### Unified Architecture
|
|
16
|
+
- **QueryService**: New unified query service eliminates code duplication between CLI and MCP
|
|
17
|
+
- **QueryFilter**: Powerful filtering engine supporting multiple criteria
|
|
18
|
+
- **Consistent API**: Same filtering syntax works in both command line and AI assistants
|
|
19
|
+
|
|
20
|
+
#### 🛠️ Technical Improvements
|
|
21
|
+
|
|
22
|
+
##### New Core Components
|
|
23
|
+
- `core/query_service.py`: Unified query execution service
|
|
24
|
+
- `core/query_filter.py`: Advanced result filtering system
|
|
25
|
+
- `cli/commands/query_command.py`: Enhanced CLI query command
|
|
26
|
+
- `mcp/tools/query_tool.py`: New MCP query tool with filtering support
|
|
27
|
+
|
|
28
|
+
##### Enhanced CLI
|
|
29
|
+
- Added `--filter` argument for query result filtering
|
|
30
|
+
- Added `--filter-help` command to display filter syntax help
|
|
31
|
+
- Improved query command to use unified QueryService
|
|
32
|
+
|
|
33
|
+
##### MCP Protocol Extensions
|
|
34
|
+
- New `query_code` tool for AI assistants
|
|
35
|
+
- Full filtering support in MCP environment
|
|
36
|
+
- Consistent with CLI filtering syntax
|
|
37
|
+
|
|
38
|
+
#### 📚 Documentation Updates
|
|
39
|
+
|
|
40
|
+
##### README Updates
|
|
41
|
+
- **Chinese (README_zh.md)**: Added comprehensive query filtering examples
|
|
42
|
+
- **English (README.md)**: Complete documentation with usage examples
|
|
43
|
+
- **Japanese (README_ja.md)**: Full translation with feature explanations
|
|
44
|
+
|
|
45
|
+
##### Training Materials
|
|
46
|
+
- Updated `training/01_onboarding.md` with new feature demonstrations
|
|
47
|
+
- Enhanced `training/02_architecture_map.md` with architecture improvements
|
|
48
|
+
- Cross-platform examples for Windows, Linux, and macOS
|
|
49
|
+
|
|
50
|
+
#### 🧪 Comprehensive Testing
|
|
51
|
+
|
|
52
|
+
##### Test Coverage
|
|
53
|
+
- **QueryService Tests**: 13 comprehensive unit tests
|
|
54
|
+
- **QueryFilter Tests**: 29 detailed filtering tests
|
|
55
|
+
- **CLI Integration Tests**: 11 real-world usage scenarios
|
|
56
|
+
- **MCP Tool Tests**: 9 tool definition and functionality tests
|
|
57
|
+
|
|
58
|
+
##### Test Categories
|
|
59
|
+
- Unit tests for core filtering logic
|
|
60
|
+
- Integration tests with real Java files
|
|
61
|
+
- Edge case handling (overloaded methods, generics, annotations)
|
|
62
|
+
- Error handling and validation
|
|
63
|
+
|
|
64
|
+
#### 🎯 Usage Examples
|
|
65
|
+
|
|
66
|
+
##### Command Line Interface
|
|
67
|
+
```bash
|
|
68
|
+
# Find specific method
|
|
69
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key methods --filter "name=main"
|
|
70
|
+
|
|
71
|
+
# Find authentication methods
|
|
72
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key methods --filter "name=~auth*"
|
|
73
|
+
|
|
74
|
+
# Find public methods with no parameters
|
|
75
|
+
uv run python -m tree_sitter_analyzer examples/BigService.java --query-key methods --filter "params=0,public=true"
|
|
76
|
+
|
|
77
|
+
# View filter syntax help
|
|
78
|
+
uv run python -m tree_sitter_analyzer --filter-help
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
##### AI Assistant (MCP)
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"tool": "query_code",
|
|
85
|
+
"arguments": {
|
|
86
|
+
"file_path": "examples/BigService.java",
|
|
87
|
+
"query_key": "methods",
|
|
88
|
+
"filter": "name=main"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### 🔧 Filter Syntax Reference
|
|
94
|
+
|
|
95
|
+
##### Supported Filters
|
|
96
|
+
- **name**: Method/function name matching
|
|
97
|
+
- Exact: `name=main`
|
|
98
|
+
- Pattern: `name=~auth*` (supports wildcards)
|
|
99
|
+
- **params**: Parameter count filtering
|
|
100
|
+
- Example: `params=0`, `params=2`
|
|
101
|
+
- **Modifiers**: Visibility and static modifiers
|
|
102
|
+
- `static=true/false`
|
|
103
|
+
- `public=true/false`
|
|
104
|
+
- `private=true/false`
|
|
105
|
+
- `protected=true/false`
|
|
106
|
+
|
|
107
|
+
##### Combining Filters
|
|
108
|
+
Use commas for AND logic: `name=~get*,params=0,public=true`
|
|
109
|
+
|
|
110
|
+
#### 🏗️ Architecture Benefits
|
|
111
|
+
|
|
112
|
+
##### Code Quality
|
|
113
|
+
- **DRY Principle**: Eliminated duplication between CLI and MCP
|
|
114
|
+
- **Single Responsibility**: Clear separation of concerns
|
|
115
|
+
- **Extensibility**: Easy to add new filter types
|
|
116
|
+
- **Maintainability**: Centralized query logic
|
|
117
|
+
|
|
118
|
+
##### Performance
|
|
119
|
+
- **Efficient Filtering**: Post-query filtering for optimal performance
|
|
120
|
+
- **Memory Optimized**: Filter after parsing, not during
|
|
121
|
+
- **Scalable**: Works efficiently with large codebases
|
|
122
|
+
|
|
123
|
+
#### 🚦 Quality Assurance
|
|
124
|
+
|
|
125
|
+
##### Code Standards
|
|
126
|
+
- **Type Safety**: Full MyPy type annotations
|
|
127
|
+
- **Code Style**: Black formatting, Ruff linting
|
|
128
|
+
- **Documentation**: Comprehensive docstrings and examples
|
|
129
|
+
- **Testing**: 62 new tests with 100% pass rate
|
|
130
|
+
|
|
131
|
+
##### Platform Support
|
|
132
|
+
- **Windows**: PowerShell examples and testing
|
|
133
|
+
- **Linux/macOS**: Bash examples and compatibility
|
|
134
|
+
- **Codespaces**: Full support for GitHub Codespaces
|
|
135
|
+
|
|
136
|
+
#### 🎯 Impact
|
|
137
|
+
|
|
138
|
+
##### Productivity Gains
|
|
139
|
+
- **Faster Code Navigation**: Find specific methods in seconds
|
|
140
|
+
- **Enhanced Code Analysis**: AI assistants can understand code structure better
|
|
141
|
+
- **Reduced Token Usage**: Extract only relevant methods for LLM analysis
|
|
142
|
+
|
|
143
|
+
##### Integration Benefits
|
|
144
|
+
- **IDE Support**: Works with Cursor, Claude Desktop, Roo Code
|
|
145
|
+
- **CLI Flexibility**: Powerful command-line filtering
|
|
146
|
+
- **API Consistency**: Same functionality across all interfaces
|
|
147
|
+
|
|
148
|
+
#### 📝 Technical Details
|
|
149
|
+
- **Files Changed**: 15+ core files
|
|
150
|
+
- **New Files**: 6 new modules and test files
|
|
151
|
+
- **Lines Added**: 2000+ lines of code and tests
|
|
152
|
+
- **Documentation**: 500+ lines of updated documentation
|
|
153
|
+
|
|
154
|
+
#### ✅ Migration Notes
|
|
155
|
+
- All existing CLI and MCP functionality remains compatible
|
|
156
|
+
- New filtering features are additive and optional
|
|
157
|
+
- No breaking changes to existing APIs
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## [0.9.5] - 2025-01-15
|
|
162
|
+
|
|
163
|
+
### 🚀 CI/CD Stability & Cross-Platform Compatibility
|
|
164
|
+
- **Enhanced CI Matrix Strategy**: Disabled `fail-fast` strategy for quality-check and test-matrix jobs, ensuring all platform/Python version combinations run to completion
|
|
165
|
+
- **Improved Test Visibility**: Better diagnosis of platform-specific issues with comprehensive matrix results
|
|
166
|
+
- **Cross-Platform Fixes**: Resolved persistent CI failures on Windows, macOS, and Linux
|
|
167
|
+
|
|
168
|
+
### 🔒 Security Improvements
|
|
169
|
+
- **macOS Symlink Safety**: Fixed symlink safety checks to properly handle macOS temporary directory symlinks (`/var` ↔ `/private/var`)
|
|
170
|
+
- **Project Boundary Management**: Enhanced boundary detection to correctly handle real paths within project boundaries
|
|
171
|
+
- **Security Code Quality**: Addressed all Bandit security linter low-risk findings:
|
|
172
|
+
- Replaced bare `pass` statements with explicit `...` for better intent documentation
|
|
173
|
+
- Added proper attribute checks for `sys.stderr` writes
|
|
174
|
+
- Replaced runtime `assert` statements with defensive type checking
|
|
175
|
+
|
|
176
|
+
### 📊 Documentation & Structure
|
|
177
|
+
- **README Enhancement**: Complete restructure with table of contents, improved content flow, and visual hierarchy
|
|
178
|
+
- **Multi-language Support**: Fully translated README into Chinese (`README_zh.md`) and Japanese (`README_ja.md`)
|
|
179
|
+
- **Documentation Standards**: Normalized line endings across all markdown files
|
|
180
|
+
- **Project Guidelines**: Added new language development guidelines and project structure documentation
|
|
181
|
+
|
|
182
|
+
### 🛠️ Code Quality Enhancements
|
|
183
|
+
- **Error Handling**: Improved robustness in `encoding_utils.py` and `utils.py` with better exception handling patterns
|
|
184
|
+
- **Platform Compatibility**: Enhanced test assertions for cross-platform compatibility
|
|
185
|
+
- **Security Practices**: Strengthened security validation while maintaining usability
|
|
186
|
+
|
|
187
|
+
### 🧪 Testing & Quality Assurance
|
|
188
|
+
- **Test Suite**: 1,358 tests passing with 74.54% coverage
|
|
189
|
+
- **Platform Coverage**: Full testing across Python 3.10-3.13 × Windows/macOS/Linux
|
|
190
|
+
- **CI Reliability**: Stable CI pipeline with comprehensive error reporting
|
|
191
|
+
|
|
192
|
+
### 🚀 Impact
|
|
193
|
+
- **Enterprise Ready**: Improved stability for production deployments
|
|
194
|
+
- **Developer Experience**: Better local development workflow with consistent tooling
|
|
195
|
+
- **AI Integration**: Enhanced MCP protocol compatibility across all supported platforms
|
|
196
|
+
- **International Reach**: Multi-language documentation for global developer community
|
|
197
|
+
|
|
2
198
|
## [0.9.4] - 2025-08-15
|
|
3
199
|
|
|
4
200
|
### 🔧 Fixed (MCP)
|
|
@@ -20,7 +20,7 @@ uv run python -c "import tree_sitter_analyzer; print('Setup OK')"
|
|
|
20
20
|
|
|
21
21
|
### Running Tests
|
|
22
22
|
|
|
23
|
-
>
|
|
23
|
+
> This project uses `uv run` for all local commands (including Windows/PowerShell). Do not call `pytest` or `python` directly to ensure consistent interpreter and virtual environment.
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
# Run all tests (1216+ tests)
|
|
@@ -190,4 +190,50 @@ This will auto-format your code and fix safe issues while skipping the ~300 lega
|
|
|
190
190
|
- Add docstrings to new functions/classes
|
|
191
191
|
- Update MCP setup guides if needed
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
## 📊 README Data Maintenance
|
|
194
|
+
|
|
195
|
+
**Important:** README files contain dynamic statistics that need regular updates!
|
|
196
|
+
|
|
197
|
+
### Data That Needs Synchronization
|
|
198
|
+
|
|
199
|
+
1. **Test Statistics**
|
|
200
|
+
- Test count: `1,358 tests`
|
|
201
|
+
- Code coverage: `74.54%`
|
|
202
|
+
- Location: Badges and quality metrics sections
|
|
203
|
+
|
|
204
|
+
2. **Version Information**
|
|
205
|
+
- Current version: From `pyproject.toml`
|
|
206
|
+
- Location: Quality achievements section
|
|
207
|
+
|
|
208
|
+
3. **Example File Statistics**
|
|
209
|
+
- BigService.java lines: `1419 lines`
|
|
210
|
+
- Method count: `66 methods`
|
|
211
|
+
- Field count: `9 fields`
|
|
212
|
+
- Class count: `1 class`
|
|
213
|
+
- Import count: `8 imports`
|
|
214
|
+
|
|
215
|
+
### Auto-update README Statistics
|
|
216
|
+
```bash
|
|
217
|
+
# Run this script after significant changes
|
|
218
|
+
python scripts/update_readme_stats.py
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### When to Update
|
|
222
|
+
- Add/remove test files
|
|
223
|
+
- Modify examples/BigService.java
|
|
224
|
+
- Update version numbers in pyproject.toml
|
|
225
|
+
- Before releases
|
|
226
|
+
- After major feature additions
|
|
227
|
+
|
|
228
|
+
### Automated Checks
|
|
229
|
+
- **Pre-commit Hook**: Runs on `git push`
|
|
230
|
+
- **GitHub Actions**: Validates README consistency on PRs
|
|
231
|
+
- **CI/CD**: Ensures main branch README is always current
|
|
232
|
+
|
|
233
|
+
### Development Workflow
|
|
234
|
+
1. Make code changes
|
|
235
|
+
2. Run quality checks: `uv run python check_quality.py --new-code-only --fix`
|
|
236
|
+
3. Update README stats: `python scripts/update_readme_stats.py`
|
|
237
|
+
4. Commit and push changes
|
|
238
|
+
|
|
239
|
+
Thank you for contributing! 🎉
|