tree-sitter-analyzer 0.9.4__tar.gz → 0.9.5__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.

Files changed (123) hide show
  1. tree_sitter_analyzer-0.9.5/.kiro/steering/product.md +32 -0
  2. tree_sitter_analyzer-0.9.5/.kiro/steering/structure.md +197 -0
  3. tree_sitter_analyzer-0.9.5/.kiro/steering/tech.md +150 -0
  4. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/.pre-commit-config.yaml +23 -1
  5. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/CHANGELOG.md +37 -0
  6. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/CONTRIBUTING.md +48 -2
  7. tree_sitter_analyzer-0.9.5/DEPLOYMENT_GUIDE.md +207 -0
  8. tree_sitter_analyzer-0.9.5/LANGUAGE_GUIDELINES.md +160 -0
  9. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/MCP_SETUP_USERS.md +2 -2
  10. tree_sitter_analyzer-0.9.5/PKG-INFO +567 -0
  11. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/PYPI_RELEASE_GUIDE.md +14 -14
  12. tree_sitter_analyzer-0.9.5/README.md +432 -0
  13. tree_sitter_analyzer-0.9.5/README_ja.md +432 -0
  14. tree_sitter_analyzer-0.9.5/README_zh.md +432 -0
  15. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/docs/api.md +3 -3
  16. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/pyproject.toml +1 -1
  17. tree_sitter_analyzer-0.9.5/scripts/improved_readme_updater.py +464 -0
  18. tree_sitter_analyzer-0.9.5/scripts/readme_config.py +133 -0
  19. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/encoding_utils.py +7 -4
  20. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/security/boundary_manager.py +10 -2
  21. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/table_formatter.py +6 -1
  22. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/utils.py +51 -40
  23. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/uv.lock +1 -1
  24. tree_sitter_analyzer-0.9.4/DEPLOYMENT_GUIDE.md +0 -278
  25. tree_sitter_analyzer-0.9.4/PKG-INFO +0 -409
  26. tree_sitter_analyzer-0.9.4/README.md +0 -274
  27. tree_sitter_analyzer-0.9.4/README_ja.md +0 -255
  28. tree_sitter_analyzer-0.9.4/README_zh.md +0 -269
  29. tree_sitter_analyzer-0.9.4/UPLOAD_COMMANDS.md +0 -90
  30. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/.gitignore +0 -0
  31. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/AI_COLLABORATION_GUIDE.md +0 -0
  32. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/CODE_STYLE_GUIDE.md +0 -0
  33. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/LLM_CODING_GUIDELINES.md +0 -0
  34. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/MCP_SETUP_DEVELOPERS.md +0 -0
  35. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/PROJECT_ROOT_CONFIG.md +0 -0
  36. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/build_standalone.py +0 -0
  37. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/check_quality.py +0 -0
  38. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/BigService.java +0 -0
  39. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/BigService.json +0 -0
  40. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/BigService.summary.json +0 -0
  41. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/JavaDocTest.java +0 -0
  42. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/MultiClass.java +0 -0
  43. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/Sample.java +0 -0
  44. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/calculate_token_comparison.py +0 -0
  45. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/project_root_demo.py +0 -0
  46. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/sample.py +0 -0
  47. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/security_demo.py +0 -0
  48. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/examples/security_integration_demo.py +0 -0
  49. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/llm_code_checker.py +0 -0
  50. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/pypirc_example.txt +0 -0
  51. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/pytest.ini +0 -0
  52. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/start_mcp_server.py +0 -0
  53. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/__init__.py +0 -0
  54. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/__main__.py +0 -0
  55. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/api.py +0 -0
  56. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/__init__.py +0 -0
  57. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/__main__.py +0 -0
  58. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/__init__.py +0 -0
  59. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/advanced_command.py +0 -0
  60. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/base_command.py +0 -0
  61. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/default_command.py +0 -0
  62. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/partial_read_command.py +0 -0
  63. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/query_command.py +0 -0
  64. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/structure_command.py +0 -0
  65. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/summary_command.py +0 -0
  66. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/commands/table_command.py +0 -0
  67. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli/info_commands.py +0 -0
  68. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/cli_main.py +0 -0
  69. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/core/__init__.py +0 -0
  70. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/core/analysis_engine.py +0 -0
  71. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/core/cache_service.py +0 -0
  72. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/core/engine.py +0 -0
  73. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/core/parser.py +0 -0
  74. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/core/query.py +0 -0
  75. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/exceptions.py +0 -0
  76. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/file_handler.py +0 -0
  77. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/formatters/__init__.py +0 -0
  78. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/formatters/base_formatter.py +0 -0
  79. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/formatters/formatter_factory.py +0 -0
  80. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/formatters/java_formatter.py +0 -0
  81. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/formatters/python_formatter.py +0 -0
  82. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/interfaces/__init__.py +0 -0
  83. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/interfaces/cli.py +0 -0
  84. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/interfaces/cli_adapter.py +0 -0
  85. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/interfaces/mcp_adapter.py +0 -0
  86. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/interfaces/mcp_server.py +0 -0
  87. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/language_detector.py +0 -0
  88. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/language_loader.py +0 -0
  89. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/languages/__init__.py +0 -0
  90. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/languages/java_plugin.py +0 -0
  91. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/languages/javascript_plugin.py +0 -0
  92. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/languages/python_plugin.py +0 -0
  93. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/__init__.py +0 -0
  94. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/resources/__init__.py +0 -0
  95. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/resources/code_file_resource.py +0 -0
  96. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/resources/project_stats_resource.py +0 -0
  97. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/server.py +0 -0
  98. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/tools/__init__.py +0 -0
  99. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +0 -0
  100. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +0 -0
  101. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/tools/base_tool.py +0 -0
  102. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/tools/read_partial_tool.py +0 -0
  103. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/tools/table_format_tool.py +0 -0
  104. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +0 -0
  105. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/utils/__init__.py +0 -0
  106. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/mcp/utils/error_handler.py +0 -0
  107. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/models.py +0 -0
  108. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/output_manager.py +0 -0
  109. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/plugins/__init__.py +0 -0
  110. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/plugins/base.py +0 -0
  111. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/plugins/manager.py +0 -0
  112. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/project_detector.py +0 -0
  113. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/queries/__init__.py +0 -0
  114. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/queries/java.py +0 -0
  115. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/queries/javascript.py +0 -0
  116. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/queries/python.py +0 -0
  117. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/queries/typescript.py +0 -0
  118. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/query_loader.py +0 -0
  119. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/security/__init__.py +0 -0
  120. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/security/regex_checker.py +0 -0
  121. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/tree_sitter_analyzer/security/validator.py +0 -0
  122. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/upload_interactive.py +0 -0
  123. {tree_sitter_analyzer-0.9.4 → tree_sitter_analyzer-0.9.5}/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,41 @@
1
1
  # Changelog
2
+ ## [0.9.5] - 2025-01-15
3
+
4
+ ### 🚀 CI/CD Stability & Cross-Platform Compatibility
5
+ - **Enhanced CI Matrix Strategy**: Disabled `fail-fast` strategy for quality-check and test-matrix jobs, ensuring all platform/Python version combinations run to completion
6
+ - **Improved Test Visibility**: Better diagnosis of platform-specific issues with comprehensive matrix results
7
+ - **Cross-Platform Fixes**: Resolved persistent CI failures on Windows, macOS, and Linux
8
+
9
+ ### 🔒 Security Improvements
10
+ - **macOS Symlink Safety**: Fixed symlink safety checks to properly handle macOS temporary directory symlinks (`/var` ↔ `/private/var`)
11
+ - **Project Boundary Management**: Enhanced boundary detection to correctly handle real paths within project boundaries
12
+ - **Security Code Quality**: Addressed all Bandit security linter low-risk findings:
13
+ - Replaced bare `pass` statements with explicit `...` for better intent documentation
14
+ - Added proper attribute checks for `sys.stderr` writes
15
+ - Replaced runtime `assert` statements with defensive type checking
16
+
17
+ ### 📊 Documentation & Structure
18
+ - **README Enhancement**: Complete restructure with table of contents, improved content flow, and visual hierarchy
19
+ - **Multi-language Support**: Fully translated README into Chinese (`README_zh.md`) and Japanese (`README_ja.md`)
20
+ - **Documentation Standards**: Normalized line endings across all markdown files
21
+ - **Project Guidelines**: Added new language development guidelines and project structure documentation
22
+
23
+ ### 🛠️ Code Quality Enhancements
24
+ - **Error Handling**: Improved robustness in `encoding_utils.py` and `utils.py` with better exception handling patterns
25
+ - **Platform Compatibility**: Enhanced test assertions for cross-platform compatibility
26
+ - **Security Practices**: Strengthened security validation while maintaining usability
27
+
28
+ ### 🧪 Testing & Quality Assurance
29
+ - **Test Suite**: 1,358 tests passing with 74.54% coverage
30
+ - **Platform Coverage**: Full testing across Python 3.10-3.13 × Windows/macOS/Linux
31
+ - **CI Reliability**: Stable CI pipeline with comprehensive error reporting
32
+
33
+ ### 🚀 Impact
34
+ - **Enterprise Ready**: Improved stability for production deployments
35
+ - **Developer Experience**: Better local development workflow with consistent tooling
36
+ - **AI Integration**: Enhanced MCP protocol compatibility across all supported platforms
37
+ - **International Reach**: Multi-language documentation for global developer community
38
+
2
39
  ## [0.9.4] - 2025-08-15
3
40
 
4
41
  ### 🔧 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
- > 本项目在所有本地命令中统一使用 `uv run`(Windows/PowerShell 亦同)。请不要直接调用裸 `pytest` `python`,以确保一致的解释器与虚拟环境。
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
- Thank you for contributing! 🎉
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! 🎉