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