thailint 0.1.6__tar.gz → 0.2.1__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.
Files changed (82) hide show
  1. {thailint-0.1.6 → thailint-0.2.1}/CHANGELOG.md +107 -2
  2. {thailint-0.1.6 → thailint-0.2.1}/PKG-INFO +414 -63
  3. thailint-0.2.1/README.md +946 -0
  4. {thailint-0.1.6 → thailint-0.2.1}/pyproject.toml +4 -1
  5. {thailint-0.1.6 → thailint-0.2.1}/src/__init__.py +7 -2
  6. thailint-0.2.1/src/analyzers/__init__.py +23 -0
  7. thailint-0.2.1/src/analyzers/typescript_base.py +148 -0
  8. {thailint-0.1.6 → thailint-0.2.1}/src/api.py +1 -1
  9. thailint-0.2.1/src/cli.py +1081 -0
  10. {thailint-0.1.6 → thailint-0.2.1}/src/config.py +6 -31
  11. {thailint-0.1.6 → thailint-0.2.1}/src/core/base.py +12 -0
  12. thailint-0.2.1/src/core/cli_utils.py +206 -0
  13. thailint-0.2.1/src/core/config_parser.py +99 -0
  14. thailint-0.2.1/src/core/linter_utils.py +168 -0
  15. thailint-0.2.1/src/core/registry.py +95 -0
  16. thailint-0.2.1/src/core/rule_discovery.py +132 -0
  17. thailint-0.2.1/src/core/violation_builder.py +122 -0
  18. {thailint-0.1.6 → thailint-0.2.1}/src/linter_config/ignore.py +112 -40
  19. {thailint-0.1.6 → thailint-0.2.1}/src/linter_config/loader.py +3 -13
  20. thailint-0.2.1/src/linters/dry/__init__.py +23 -0
  21. thailint-0.2.1/src/linters/dry/base_token_analyzer.py +76 -0
  22. thailint-0.2.1/src/linters/dry/block_filter.py +262 -0
  23. thailint-0.2.1/src/linters/dry/block_grouper.py +59 -0
  24. thailint-0.2.1/src/linters/dry/cache.py +218 -0
  25. thailint-0.2.1/src/linters/dry/cache_query.py +61 -0
  26. thailint-0.2.1/src/linters/dry/config.py +130 -0
  27. thailint-0.2.1/src/linters/dry/config_loader.py +44 -0
  28. thailint-0.2.1/src/linters/dry/deduplicator.py +120 -0
  29. thailint-0.2.1/src/linters/dry/duplicate_storage.py +126 -0
  30. thailint-0.2.1/src/linters/dry/file_analyzer.py +127 -0
  31. thailint-0.2.1/src/linters/dry/inline_ignore.py +140 -0
  32. thailint-0.2.1/src/linters/dry/linter.py +170 -0
  33. thailint-0.2.1/src/linters/dry/python_analyzer.py +517 -0
  34. thailint-0.2.1/src/linters/dry/storage_initializer.py +51 -0
  35. thailint-0.2.1/src/linters/dry/token_hasher.py +115 -0
  36. thailint-0.2.1/src/linters/dry/typescript_analyzer.py +590 -0
  37. thailint-0.2.1/src/linters/dry/violation_builder.py +74 -0
  38. thailint-0.2.1/src/linters/dry/violation_filter.py +91 -0
  39. thailint-0.2.1/src/linters/dry/violation_generator.py +174 -0
  40. thailint-0.2.1/src/linters/file_placement/config_loader.py +86 -0
  41. thailint-0.2.1/src/linters/file_placement/directory_matcher.py +80 -0
  42. thailint-0.2.1/src/linters/file_placement/linter.py +401 -0
  43. thailint-0.2.1/src/linters/file_placement/path_resolver.py +61 -0
  44. thailint-0.2.1/src/linters/file_placement/pattern_matcher.py +55 -0
  45. thailint-0.2.1/src/linters/file_placement/pattern_validator.py +106 -0
  46. thailint-0.2.1/src/linters/file_placement/rule_checker.py +229 -0
  47. thailint-0.2.1/src/linters/file_placement/violation_factory.py +177 -0
  48. {thailint-0.1.6 → thailint-0.2.1}/src/linters/nesting/config.py +13 -3
  49. thailint-0.2.1/src/linters/nesting/linter.py +181 -0
  50. thailint-0.2.1/src/linters/nesting/typescript_analyzer.py +116 -0
  51. thailint-0.2.1/src/linters/nesting/typescript_function_extractor.py +130 -0
  52. thailint-0.2.1/src/linters/nesting/violation_builder.py +139 -0
  53. thailint-0.2.1/src/linters/srp/__init__.py +99 -0
  54. thailint-0.2.1/src/linters/srp/class_analyzer.py +113 -0
  55. thailint-0.2.1/src/linters/srp/config.py +76 -0
  56. thailint-0.2.1/src/linters/srp/heuristics.py +89 -0
  57. thailint-0.2.1/src/linters/srp/linter.py +225 -0
  58. thailint-0.2.1/src/linters/srp/metrics_evaluator.py +47 -0
  59. thailint-0.2.1/src/linters/srp/python_analyzer.py +72 -0
  60. thailint-0.2.1/src/linters/srp/typescript_analyzer.py +75 -0
  61. thailint-0.2.1/src/linters/srp/typescript_metrics_calculator.py +90 -0
  62. thailint-0.2.1/src/linters/srp/violation_builder.py +117 -0
  63. {thailint-0.1.6 → thailint-0.2.1}/src/orchestrator/core.py +42 -7
  64. thailint-0.2.1/src/utils/__init__.py +4 -0
  65. thailint-0.2.1/src/utils/project_root.py +84 -0
  66. thailint-0.1.6/README.md +0 -596
  67. thailint-0.1.6/src/.ai/layout.yaml +0 -48
  68. thailint-0.1.6/src/cli.py +0 -698
  69. thailint-0.1.6/src/core/registry.py +0 -170
  70. thailint-0.1.6/src/linters/file_placement/linter.py +0 -621
  71. thailint-0.1.6/src/linters/nesting/linter.py +0 -257
  72. thailint-0.1.6/src/linters/nesting/typescript_analyzer.py +0 -180
  73. {thailint-0.1.6 → thailint-0.2.1}/LICENSE +0 -0
  74. {thailint-0.1.6 → thailint-0.2.1}/src/core/__init__.py +0 -0
  75. {thailint-0.1.6 → thailint-0.2.1}/src/core/types.py +0 -0
  76. {thailint-0.1.6 → thailint-0.2.1}/src/linter_config/__init__.py +0 -0
  77. {thailint-0.1.6 → thailint-0.2.1}/src/linters/__init__.py +0 -0
  78. {thailint-0.1.6 → thailint-0.2.1}/src/linters/file_placement/__init__.py +0 -0
  79. {thailint-0.1.6 → thailint-0.2.1}/src/linters/nesting/__init__.py +0 -0
  80. {thailint-0.1.6 → thailint-0.2.1}/src/linters/nesting/python_analyzer.py +0 -0
  81. {thailint-0.1.6 → thailint-0.2.1}/src/orchestrator/__init__.py +0 -0
  82. {thailint-0.1.6 → thailint-0.2.1}/src/orchestrator/language_detector.py +0 -0
@@ -24,6 +24,111 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
24
24
 
25
25
  ## [Unreleased]
26
26
 
27
+ ## [0.2.1] - 2025-10-09
28
+
29
+ **Docker Path Validation Fix** - Fixes critical Docker image bug where file-specific linting failed due to premature path validation.
30
+
31
+ ### Fixed
32
+
33
+ - **Docker Path Validation** - Removed Click's `exists=True` parameter that validated paths before Docker volumes were mounted
34
+ - All linter commands now work with file paths in Docker: `docker run -v $(pwd):/data thailint nesting /data/file.py`
35
+ - Better error messages when paths don't exist, with Docker usage hints
36
+ - Manual path validation happens after argument parsing, compatible with both CLI and Docker contexts
37
+
38
+ ### Changed
39
+
40
+ - Path validation moved from Click argument parsing to execution functions
41
+ - Added `_validate_paths_exist()` helper function with user-friendly error messages
42
+
43
+ ## [0.3.0] - TBD
44
+
45
+ **Single Responsibility Principle (SRP) Linter Release** - Adds comprehensive SRP violation detection for Python and TypeScript code. Uses heuristic-based analysis with configurable thresholds for method count, lines of code, and responsibility keywords. Includes language-specific configurations and extensive refactoring pattern documentation.
46
+
47
+ ### Added
48
+
49
+ - **SRP Linter** - Complete Single Responsibility Principle violation detection
50
+ - Heuristic-based analysis using method count, LOC, and keyword detection
51
+ - Configurable thresholds: `max_methods` (default: 7), `max_loc` (default: 200)
52
+ - Language-specific thresholds for Python, TypeScript, and JavaScript
53
+ - Responsibility keyword detection (Manager, Handler, Processor, Utility, Helper)
54
+ - AST-based analysis using Python `ast` module and `tree-sitter-typescript`
55
+ - Helpful violation messages with refactoring suggestions
56
+
57
+ - **CLI Command: `thailint srp`**
58
+ - `thailint srp [PATH]` - Check files for SRP violations
59
+ - `--max-methods N` - Override method count threshold
60
+ - `--max-loc N` - Override lines of code threshold
61
+ - `--config PATH` - Use specific config file
62
+ - `--format json/text` - Output format selection
63
+ - `--help` - Comprehensive command documentation
64
+
65
+ - **Library API**
66
+ - `srp_lint(path, config)` - Convenience function
67
+ - `SRPRule` - Direct rule class for advanced usage
68
+ - `from src import srp_lint, SRPRule` - Exported in package
69
+
70
+ - **Comprehensive Documentation**
71
+ - `docs/srp-linter.md` - Complete SRP linter guide
72
+ - Configuration examples and best practices
73
+ - 4 refactoring patterns with before/after code examples
74
+ - CI/CD integration examples (GitHub Actions, pre-commit hooks)
75
+ - Troubleshooting guide and common issues
76
+ - Real-world refactoring examples
77
+
78
+ - **Language-Specific Configuration**
79
+ - Python: More strict thresholds (8 methods, 200 LOC)
80
+ - TypeScript: More lenient thresholds (10 methods, 250 LOC) for type verbosity
81
+ - JavaScript: Balanced thresholds (10 methods, 225 LOC)
82
+ - Configurable keyword list for responsibility detection
83
+
84
+ - **Test Suite**
85
+ - 91 tests for SRP linter (100% passing)
86
+ - Python SRP tests (20 tests)
87
+ - TypeScript SRP tests (20 tests)
88
+ - Configuration tests (10 tests)
89
+ - Integration tests (13 tests)
90
+ - Edge case tests (10 tests)
91
+ - Violation message tests (8 tests)
92
+ - Ignore directive tests (10 tests)
93
+
94
+ - **Refactoring Patterns Documentation**
95
+ - Extract Class pattern (split god classes into focused classes)
96
+ - Split Configuration/Logic pattern (separate concerns)
97
+ - Extract Language-Specific Logic pattern (per-language analyzers)
98
+ - Utility Module pattern (group related helpers)
99
+
100
+ ### Changed
101
+
102
+ - **Code Quality Improvements**
103
+ - Refactored 6 classes with SRP violations
104
+ - Applied Extract Class pattern to large classes
105
+ - Improved modularity and maintainability
106
+ - Zero SRP violations in codebase
107
+
108
+ - **README Updates**
109
+ - Added comprehensive SRP linter section with examples
110
+ - Updated feature list with SRP capabilities
111
+ - Added refactoring patterns and examples
112
+
113
+ ### Fixed
114
+
115
+ - Language-specific configuration loading for SRP thresholds
116
+ - Config priority: language-specific → top-level → built-in defaults
117
+
118
+ ### Documentation
119
+
120
+ - Complete SRP linter guide (`docs/srp-linter.md`)
121
+ - Updated CLI reference with SRP command
122
+ - Configuration examples for SRP rules
123
+ - 4 refactoring patterns with code examples
124
+ - Real-world refactoring case studies
125
+
126
+ ### Infrastructure
127
+
128
+ - Updated Makefile with `just lint-solid` target
129
+ - Integrated SRP checks into quality gates
130
+ - CI/CD ready (proper exit codes and JSON output)
131
+
27
132
  ## [0.2.0] - 2025-10-07
28
133
 
29
134
  **Nesting Depth Linter Release** - Adds comprehensive nesting depth analysis for Python and TypeScript code. Includes AST-based analysis with tree-sitter, configurable depth limits, and extensive refactoring patterns. Validated on the thai-lint codebase (zero violations after refactoring 23 functions).
@@ -143,8 +248,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
143
248
 
144
249
  ### Infrastructure
145
250
 
146
- - Updated Makefile with `make lint-nesting` target
147
- - Integrated nesting checks into `make lint-full`
251
+ - Updated Makefile with `just lint-nesting` target
252
+ - Integrated nesting checks into `just lint-full`
148
253
  - CI/CD ready (proper exit codes and JSON output)
149
254
 
150
255
  ## [0.1.0] - 2025-10-06