thailint 0.4.5__py3-none-any.whl → 0.4.6__py3-none-any.whl
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.
- src/linters/dry/typescript_analyzer.py +7 -5
- {thailint-0.4.5.dist-info → thailint-0.4.6.dist-info}/METADATA +31 -30
- {thailint-0.4.5.dist-info → thailint-0.4.6.dist-info}/RECORD +6 -6
- {thailint-0.4.5.dist-info → thailint-0.4.6.dist-info}/WHEEL +0 -0
- {thailint-0.4.5.dist-info → thailint-0.4.6.dist-info}/entry_points.txt +0 -0
- {thailint-0.4.5.dist-info → thailint-0.4.6.dist-info}/licenses/LICENSE +0 -0
|
@@ -186,20 +186,22 @@ class TypeScriptDuplicateAnalyzer(BaseTokenAnalyzer): # thailint: ignore[srp.vi
|
|
|
186
186
|
List of (original_line_number, normalized_code) tuples
|
|
187
187
|
"""
|
|
188
188
|
lines_with_numbers = []
|
|
189
|
+
in_multiline_import = False
|
|
189
190
|
|
|
190
191
|
for line_num, line in enumerate(content.split("\n"), start=1):
|
|
191
192
|
# Skip JSDoc comment lines
|
|
192
193
|
if line_num in jsdoc_lines:
|
|
193
194
|
continue
|
|
194
195
|
|
|
195
|
-
|
|
196
|
-
line = self._hasher._strip_comments(line) # pylint: disable=protected-access
|
|
197
|
-
line = " ".join(line.split())
|
|
198
|
-
|
|
196
|
+
line = self._hasher._normalize_line(line) # pylint: disable=protected-access
|
|
199
197
|
if not line:
|
|
200
198
|
continue
|
|
201
199
|
|
|
202
|
-
if
|
|
200
|
+
# Update multi-line import state and check if line should be skipped
|
|
201
|
+
in_multiline_import, should_skip = self._hasher._should_skip_import_line( # pylint: disable=protected-access
|
|
202
|
+
line, in_multiline_import
|
|
203
|
+
)
|
|
204
|
+
if should_skip:
|
|
203
205
|
continue
|
|
204
206
|
|
|
205
207
|
lines_with_numbers.append((line_num, line))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: thailint
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.6
|
|
4
4
|
Summary: The AI Linter - Enterprise-grade linting and governance for AI-generated code across multiple languages
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -28,7 +28,7 @@ Requires-Dist: pyprojroot (>=0.3.0,<0.4.0)
|
|
|
28
28
|
Requires-Dist: pyyaml (>=6.0,<7.0)
|
|
29
29
|
Requires-Dist: tree-sitter (>=0.25.2,<0.26.0)
|
|
30
30
|
Requires-Dist: tree-sitter-typescript (>=0.23.2,<0.24.0)
|
|
31
|
-
Project-URL: Documentation, https://
|
|
31
|
+
Project-URL: Documentation, https://thai-lint.readthedocs.io/
|
|
32
32
|
Project-URL: Homepage, https://github.com/be-wise-be-kind/thai-lint
|
|
33
33
|
Project-URL: Repository, https://github.com/be-wise-be-kind/thai-lint
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
@@ -37,19 +37,20 @@ Description-Content-Type: text/markdown
|
|
|
37
37
|
|
|
38
38
|
[](https://opensource.org/licenses/MIT)
|
|
39
39
|
[](https://www.python.org/downloads/)
|
|
40
|
-
[](tests/)
|
|
41
41
|
[](htmlcov/)
|
|
42
|
+
[](https://thai-lint.readthedocs.io/en/latest/?badge=latest)
|
|
42
43
|
|
|
43
44
|
The AI Linter - Enterprise-ready linting and governance for AI-generated code across multiple languages.
|
|
44
45
|
|
|
45
46
|
## Documentation
|
|
46
47
|
|
|
47
48
|
**New to thailint?** Start here:
|
|
48
|
-
- **[Quick Start Guide](
|
|
49
|
-
- **[Configuration Reference](
|
|
50
|
-
- **[Troubleshooting Guide](
|
|
49
|
+
- **[Quick Start Guide](https://thai-lint.readthedocs.io/en/latest/quick-start/)** - Get running in 5 minutes
|
|
50
|
+
- **[Configuration Reference](https://thai-lint.readthedocs.io/en/latest/configuration/)** - Complete config options for all linters
|
|
51
|
+
- **[Troubleshooting Guide](https://thai-lint.readthedocs.io/en/latest/troubleshooting/)** - Common issues and solutions
|
|
51
52
|
|
|
52
|
-
**Full Documentation:** Browse the **[
|
|
53
|
+
**Full Documentation:** Browse the **[documentation site](https://thai-lint.readthedocs.io/)** for comprehensive guides covering installation, all linters, configuration patterns, and integration examples.
|
|
53
54
|
|
|
54
55
|
## Overview
|
|
55
56
|
|
|
@@ -66,7 +67,7 @@ We're not trying to replace the wonderful existing linters like Pylint, ESLint,
|
|
|
66
67
|
|
|
67
68
|
thailint complements your existing linting stack by catching the patterns AI tools repeatedly miss.
|
|
68
69
|
|
|
69
|
-
**Complete documentation available
|
|
70
|
+
**Complete documentation available at [thai-lint.readthedocs.io](https://thai-lint.readthedocs.io/)** covering installation, configuration, all linters, and troubleshooting.
|
|
70
71
|
|
|
71
72
|
## Features
|
|
72
73
|
|
|
@@ -164,7 +165,7 @@ thailint dry --config .thailint.yaml src/
|
|
|
164
165
|
thailint dry --format json src/
|
|
165
166
|
```
|
|
166
167
|
|
|
167
|
-
**New to thailint?** See the **[Quick Start Guide](
|
|
168
|
+
**New to thailint?** See the **[Quick Start Guide](https://thai-lint.readthedocs.io/en/latest/quick-start/)** for a complete walkthrough including config generation, understanding output, and next steps.
|
|
168
169
|
|
|
169
170
|
### Library Mode
|
|
170
171
|
|
|
@@ -356,9 +357,9 @@ magic-numbers:
|
|
|
356
357
|
}
|
|
357
358
|
```
|
|
358
359
|
|
|
359
|
-
See [Configuration Guide](
|
|
360
|
+
See [Configuration Guide](https://thai-lint.readthedocs.io/en/latest/configuration/) for complete reference.
|
|
360
361
|
|
|
361
|
-
**Need help with ignores?** See **[How to Ignore Violations](
|
|
362
|
+
**Need help with ignores?** See **[How to Ignore Violations](https://thai-lint.readthedocs.io/en/latest/how-to-ignore-violations/)** for complete guide to all ignore levels (line, method, class, file, repository).
|
|
362
363
|
|
|
363
364
|
## Nesting Depth Linter
|
|
364
365
|
|
|
@@ -444,7 +445,7 @@ Common patterns to reduce nesting:
|
|
|
444
445
|
- **TypeScript**: Full support (if/for/while/try/switch)
|
|
445
446
|
- **JavaScript**: Supported via TypeScript parser
|
|
446
447
|
|
|
447
|
-
See [Nesting Linter Guide](
|
|
448
|
+
See [Nesting Linter Guide](https://thai-lint.readthedocs.io/en/latest/nesting-linter/) for comprehensive documentation and refactoring patterns.
|
|
448
449
|
|
|
449
450
|
## Single Responsibility Principle (SRP) Linter
|
|
450
451
|
|
|
@@ -561,7 +562,7 @@ Common patterns to fix SRP violations (discovered during dogfooding):
|
|
|
561
562
|
- **After**: Extract Class pattern applied - 5 focused classes (ConfigLoader, PatternValidator, RuleChecker, PathResolver, FilePlacementLinter)
|
|
562
563
|
- **Result**: Each class ≤8 methods, ≤150 LOC, single responsibility
|
|
563
564
|
|
|
564
|
-
See [SRP Linter Guide](
|
|
565
|
+
See [SRP Linter Guide](https://thai-lint.readthedocs.io/en/latest/srp-linter/) for comprehensive documentation and refactoring patterns.
|
|
565
566
|
|
|
566
567
|
## DRY Linter (Don't Repeat Yourself)
|
|
567
568
|
|
|
@@ -714,7 +715,7 @@ Built-in filters automatically exclude common non-duplication patterns:
|
|
|
714
715
|
3. **Extract Utility Module**: Move helper functions to shared utilities
|
|
715
716
|
4. **Template Method**: Use function parameters for variations
|
|
716
717
|
|
|
717
|
-
See [DRY Linter Guide](
|
|
718
|
+
See [DRY Linter Guide](https://thai-lint.readthedocs.io/en/latest/dry-linter/) for comprehensive documentation, storage modes, and refactoring patterns.
|
|
718
719
|
|
|
719
720
|
## Magic Numbers Linter
|
|
720
721
|
|
|
@@ -866,7 +867,7 @@ def get_ports(): # thailint: ignore[magic-numbers] - Standard ports
|
|
|
866
867
|
# thailint: ignore-file[magic-numbers]
|
|
867
868
|
```
|
|
868
869
|
|
|
869
|
-
See **[How to Ignore Violations](
|
|
870
|
+
See **[How to Ignore Violations](https://thai-lint.readthedocs.io/en/latest/how-to-ignore-violations/)** and **[Magic Numbers Linter Guide](https://thai-lint.readthedocs.io/en/latest/magic-numbers-linter/)** for complete documentation.
|
|
870
871
|
|
|
871
872
|
## Pre-commit Hooks
|
|
872
873
|
|
|
@@ -928,7 +929,7 @@ repos:
|
|
|
928
929
|
pass_filenames: true
|
|
929
930
|
```
|
|
930
931
|
|
|
931
|
-
See **[Pre-commit Hooks Guide](
|
|
932
|
+
See **[Pre-commit Hooks Guide](https://thai-lint.readthedocs.io/en/latest/pre-commit-hooks/)** for complete documentation, troubleshooting, and advanced configuration.
|
|
932
933
|
|
|
933
934
|
## Common Use Cases
|
|
934
935
|
|
|
@@ -1145,20 +1146,20 @@ docker run --rm -v /path/to/workspace:/workspace \
|
|
|
1145
1146
|
|
|
1146
1147
|
### Comprehensive Guides
|
|
1147
1148
|
|
|
1148
|
-
- **[Getting Started](
|
|
1149
|
-
- **[Configuration Reference](
|
|
1150
|
-
- **[How to Ignore Violations](
|
|
1151
|
-
- **[API Reference](
|
|
1152
|
-
- **[CLI Reference](
|
|
1153
|
-
- **[Deployment Modes](
|
|
1154
|
-
- **[File Placement Linter](
|
|
1155
|
-
- **[Magic Numbers Linter](
|
|
1156
|
-
- **[Nesting Depth Linter](
|
|
1157
|
-
- **[SRP Linter](
|
|
1158
|
-
- **[DRY Linter](
|
|
1159
|
-
- **[Pre-commit Hooks](
|
|
1160
|
-
- **[Publishing Guide](
|
|
1161
|
-
- **[Publishing Checklist](
|
|
1149
|
+
- **[Getting Started](https://thai-lint.readthedocs.io/en/latest/getting-started/)** - Installation, first lint, basic config
|
|
1150
|
+
- **[Configuration Reference](https://thai-lint.readthedocs.io/en/latest/configuration/)** - Complete config options (YAML/JSON)
|
|
1151
|
+
- **[How to Ignore Violations](https://thai-lint.readthedocs.io/en/latest/how-to-ignore-violations/)** - Complete guide to all ignore levels
|
|
1152
|
+
- **[API Reference](https://thai-lint.readthedocs.io/en/latest/api-reference/)** - Library API documentation
|
|
1153
|
+
- **[CLI Reference](https://thai-lint.readthedocs.io/en/latest/cli-reference/)** - All CLI commands and options
|
|
1154
|
+
- **[Deployment Modes](https://thai-lint.readthedocs.io/en/latest/deployment-modes/)** - CLI, Library, and Docker usage
|
|
1155
|
+
- **[File Placement Linter](https://thai-lint.readthedocs.io/en/latest/file-placement-linter/)** - Detailed linter guide
|
|
1156
|
+
- **[Magic Numbers Linter](https://thai-lint.readthedocs.io/en/latest/magic-numbers-linter/)** - Magic numbers detection guide
|
|
1157
|
+
- **[Nesting Depth Linter](https://thai-lint.readthedocs.io/en/latest/nesting-linter/)** - Nesting depth analysis guide
|
|
1158
|
+
- **[SRP Linter](https://thai-lint.readthedocs.io/en/latest/srp-linter/)** - Single Responsibility Principle guide
|
|
1159
|
+
- **[DRY Linter](https://thai-lint.readthedocs.io/en/latest/dry-linter/)** - Duplicate code detection guide
|
|
1160
|
+
- **[Pre-commit Hooks](https://thai-lint.readthedocs.io/en/latest/pre-commit-hooks/)** - Automated quality checks
|
|
1161
|
+
- **[Publishing Guide](https://thai-lint.readthedocs.io/en/latest/releasing/)** - Release and publishing workflow
|
|
1162
|
+
- **[Publishing Checklist](https://thai-lint.readthedocs.io/en/latest/publishing-checklist/)** - Post-publication validation
|
|
1162
1163
|
|
|
1163
1164
|
### Examples
|
|
1164
1165
|
|
|
@@ -33,7 +33,7 @@ src/linters/dry/linter.py,sha256=XMLwCgGrFX0l0dVUJs1jpsXOfgxeKKDbxOtN5h5Emhk,583
|
|
|
33
33
|
src/linters/dry/python_analyzer.py,sha256=jmMUw2YhwkRrAJJDHaHKffGUjCiz5OzWwv_ZJrzNXqw,27367
|
|
34
34
|
src/linters/dry/storage_initializer.py,sha256=ykMALFs4uMUrN0_skEwySDl_t5Dm_LGHllF0OxDhiUI,1366
|
|
35
35
|
src/linters/dry/token_hasher.py,sha256=71njBzUsWvQjIWo38AKeRHQsG8K4jrjLTKuih-i6Gis,5372
|
|
36
|
-
src/linters/dry/typescript_analyzer.py,sha256=
|
|
36
|
+
src/linters/dry/typescript_analyzer.py,sha256=ShNoB2KfPe010wKEZoFxn-ZKh0MnRUwgADDQKQtfedI,21627
|
|
37
37
|
src/linters/dry/violation_builder.py,sha256=EUiEQIOZjzAoHEqZiIR8WZP8m4dgqJjcveR5mdMyClI,2803
|
|
38
38
|
src/linters/dry/violation_filter.py,sha256=aTOMz8kXG2sZlSVcf3cAxgxHs7f2kBXInfr1V_04fUQ,3125
|
|
39
39
|
src/linters/dry/violation_generator.py,sha256=cc6aKvTxtHSZm0F7Y-gL1bmD3JUphRmAvcbqk9aUzGg,6128
|
|
@@ -83,8 +83,8 @@ src/orchestrator/language_detector.py,sha256=rHyVMApit80NTTNyDH1ObD1usKD8LjGmH3D
|
|
|
83
83
|
src/templates/thailint_config_template.yaml,sha256=u8WFv2coE4uqfgf_slw7xjo4kGYIowDm1RIgxsKQzrE,4275
|
|
84
84
|
src/utils/__init__.py,sha256=NiBtKeQ09Y3kuUzeN4O1JNfUIYPQDS2AP1l5ODq-Dec,125
|
|
85
85
|
src/utils/project_root.py,sha256=b3YTEGTa9RPcOeHn1IByMMWyRiUabfVlpnlektL0A0o,6156
|
|
86
|
-
thailint-0.4.
|
|
87
|
-
thailint-0.4.
|
|
88
|
-
thailint-0.4.
|
|
89
|
-
thailint-0.4.
|
|
90
|
-
thailint-0.4.
|
|
86
|
+
thailint-0.4.6.dist-info/METADATA,sha256=3iBTAjUgiuhAv4-_oU4Bjn96LP1Xyl8tFdV8YH2NitI,37855
|
|
87
|
+
thailint-0.4.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
88
|
+
thailint-0.4.6.dist-info/entry_points.txt,sha256=l7DQJgU18sVLDpSaXOXY3lLhnQHQIRrSJZTQjG1cEAk,62
|
|
89
|
+
thailint-0.4.6.dist-info/licenses/LICENSE,sha256=kxh1J0Sb62XvhNJ6MZsVNe8PqNVJ7LHRn_EWa-T3djw,1070
|
|
90
|
+
thailint-0.4.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|