thailint 0.1.0__py3-none-any.whl → 0.1.3__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/__init__.py CHANGED
@@ -8,8 +8,9 @@ Overview: Initializes the CLI application package, defines version number using
8
8
  setup tools, CLI help text, and documentation. Exports main CLI entry point, high-level Linter
9
9
  class for library usage, configuration utilities, and direct linter imports for advanced usage.
10
10
  Includes nesting depth linter exports for convenient access to nesting analysis functionality.
11
+ Version is dynamically loaded from package metadata (pyproject.toml) using importlib.metadata.
11
12
 
12
- Dependencies: None (minimal imports for package initialization)
13
+ Dependencies: importlib.metadata for dynamic version loading from installed package metadata
13
14
 
14
15
  Exports: __version__, Linter (high-level API), cli (CLI entry point), load_config, save_config,
15
16
  ConfigError, Orchestrator (advanced usage), file_placement_lint, nesting_lint, NestingDepthRule
@@ -17,7 +18,13 @@ Exports: __version__, Linter (high-level API), cli (CLI entry point), load_confi
17
18
  Interfaces: Package version string, Linter class API, CLI command group, configuration functions
18
19
  """
19
20
 
20
- __version__ = "0.1.0"
21
+ try:
22
+ from importlib.metadata import version
23
+
24
+ __version__ = version("thailint")
25
+ except Exception:
26
+ # Fallback for development when package is not installed
27
+ __version__ = "dev"
21
28
 
22
29
  # High-level Library API (primary interface)
23
30
  from src.api import Linter
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: thailint
3
- Version: 0.1.0
3
+ Version: 0.1.3
4
4
  Summary: The AI Linter - Enterprise-grade linting and governance for AI-generated code across multiple languages
5
5
  License: MIT
6
6
  Keywords: linter,ai,code-quality,static-analysis,file-placement,governance,multi-language,cli,docker,python
@@ -90,11 +90,11 @@ pip install thai-lint
90
90
  ### With Docker
91
91
 
92
92
  ```bash
93
- # Build image
94
- docker-compose -f docker-compose.cli.yml build
93
+ # Pull from Docker Hub
94
+ docker pull washad/thailint:latest
95
95
 
96
96
  # Run CLI
97
- docker-compose -f docker-compose.cli.yml run cli --help
97
+ docker run --rm washad/thailint:latest --help
98
98
  ```
99
99
 
100
100
  ## Quick Start
@@ -103,16 +103,16 @@ docker-compose -f docker-compose.cli.yml run cli --help
103
103
 
104
104
  ```bash
105
105
  # Check file placement
106
- thai-lint file-placement .
106
+ thailint file-placement .
107
107
 
108
108
  # Check nesting depth
109
- thai-lint nesting src/
109
+ thailint nesting src/
110
110
 
111
111
  # With config file
112
- thai-lint nesting --config .thailint.yaml src/
112
+ thailint nesting --config .thailint.yaml src/
113
113
 
114
114
  # JSON output for CI/CD
115
- thai-lint nesting --format json src/
115
+ thailint nesting --format json src/
116
116
  ```
117
117
 
118
118
  ### Library Mode
@@ -136,11 +136,12 @@ if violations:
136
136
 
137
137
  ```bash
138
138
  # Run with volume mount
139
- docker run --rm -v $(pwd):/workspace \
140
- thailint/thailint file-placement /workspace
139
+ docker run --rm -v $(pwd):/data \
140
+ washad/thailint:latest file-placement /data
141
141
 
142
- # With docker-compose
143
- docker-compose run cli file-placement .
142
+ # Check nesting depth
143
+ docker run --rm -v $(pwd):/data \
144
+ washad/thailint:latest nesting /data
144
145
  ```
145
146
 
146
147
  ## Configuration
@@ -150,6 +151,8 @@ Create `.thailint.yaml` in your project root:
150
151
  ```yaml
151
152
  # File placement linter configuration
152
153
  file-placement:
154
+ enabled: true
155
+
153
156
  # Global patterns apply to entire project
154
157
  global_patterns:
155
158
  deny:
@@ -174,6 +177,20 @@ file-placement:
174
177
  - "__pycache__/"
175
178
  - "*.pyc"
176
179
  - ".venv/"
180
+
181
+ # Nesting depth linter configuration
182
+ nesting:
183
+ enabled: true
184
+ max_nesting_depth: 4 # Maximum allowed nesting depth
185
+
186
+ # Language-specific settings (optional)
187
+ languages:
188
+ python:
189
+ max_depth: 4
190
+ typescript:
191
+ max_depth: 4
192
+ javascript:
193
+ max_depth: 4
177
194
  ```
178
195
 
179
196
  **JSON format also supported** (`.thailint.json`):
@@ -181,6 +198,7 @@ file-placement:
181
198
  ```json
182
199
  {
183
200
  "file-placement": {
201
+ "enabled": true,
184
202
  "directories": {
185
203
  "src": {
186
204
  "allow": [".*\\.py$"],
@@ -188,6 +206,14 @@ file-placement:
188
206
  }
189
207
  },
190
208
  "ignore": ["__pycache__/", "*.pyc"]
209
+ },
210
+ "nesting": {
211
+ "enabled": true,
212
+ "max_nesting_depth": 4,
213
+ "languages": {
214
+ "python": { "max_depth": 4 },
215
+ "typescript": { "max_depth": 4 }
216
+ }
191
217
  }
192
218
  }
193
219
  ```
@@ -204,13 +230,13 @@ The nesting depth linter detects deeply nested code (if/for/while/try statements
204
230
 
205
231
  ```bash
206
232
  # Check nesting depth in current directory
207
- thai-lint nesting .
233
+ thailint nesting .
208
234
 
209
235
  # Use strict limit (max depth 3)
210
- thai-lint nesting --max-depth 3 src/
236
+ thailint nesting --max-depth 3 src/
211
237
 
212
238
  # Get JSON output
213
- thai-lint nesting --format json src/
239
+ thailint nesting --format json src/
214
240
  ```
215
241
 
216
242
  ### Configuration
@@ -311,7 +337,7 @@ pre-commit run --all-files
311
337
  **On every commit:**
312
338
  - 🚫 Prevents commits to main/master branch
313
339
  - 🎨 Auto-fixes formatting issues
314
- - ✅ Runs thai-lint on changed files (fast)
340
+ - ✅ Runs thailint on changed files (fast)
315
341
 
316
342
  **On every push:**
317
343
  - 🔍 Full linting on entire codebase
@@ -339,7 +365,7 @@ repos:
339
365
  language: system
340
366
  pass_filenames: false
341
367
 
342
- # Run thai-lint on changed files
368
+ # Run thailint on changed files
343
369
  - id: lint-changed
344
370
  name: Lint changed files
345
371
  entry: make lint-full FILES=changed
@@ -437,28 +463,30 @@ mypy src/
437
463
 
438
464
  ```bash
439
465
  # Build Python package
440
- python -m build
466
+ poetry build
441
467
 
442
- # Build Docker image
443
- docker-compose -f docker-compose.cli.yml build
468
+ # Build Docker image locally (optional)
469
+ docker build -t washad/thailint:latest .
444
470
  ```
445
471
 
446
472
  ## Docker Usage
447
473
 
448
474
  ```bash
449
- # Build image
450
- docker-compose -f docker-compose.cli.yml build
475
+ # Pull published image
476
+ docker pull washad/thailint:latest
451
477
 
452
478
  # Run CLI help
453
- docker-compose -f docker-compose.cli.yml run cli --help
479
+ docker run --rm washad/thailint:latest --help
480
+
481
+ # Run file-placement linter
482
+ docker run --rm -v $(pwd):/data washad/thailint:latest file-placement /data
454
483
 
455
- # Run hello command
456
- docker-compose -f docker-compose.cli.yml run cli hello --name Docker
484
+ # Run nesting linter
485
+ docker run --rm -v $(pwd):/data washad/thailint:latest nesting /data
457
486
 
458
- # With config volume
459
- docker-compose -f docker-compose.cli.yml run \
460
- -v $(pwd)/config:/config:ro \
461
- cli --config /config/config.yaml hello
487
+ # With custom config
488
+ docker run --rm -v $(pwd):/data \
489
+ washad/thailint:latest nesting --config /data/.thailint.yaml /data
462
490
  ```
463
491
 
464
492
  ## Documentation
@@ -566,7 +594,7 @@ thailint uses standard exit codes for CI/CD integration:
566
594
  - **2** - Error occurred (invalid config, file not found, etc.)
567
595
 
568
596
  ```bash
569
- thai-lint file-placement .
597
+ thailint file-placement .
570
598
  if [ $? -eq 0 ]; then
571
599
  echo "✅ Linting passed"
572
600
  else
@@ -1,5 +1,5 @@
1
1
  src/.ai/layout.yaml,sha256=yF79hvJOQDCm8Y75OpMfJzVr0ORR4n4MpokIh3Ff84w,953
2
- src/__init__.py,sha256=E0i84M6mA2-YIK8SN3zcQ2mw1gG-EXbRvl0Z3WE0cIg,1746
2
+ src/__init__.py,sha256=OZ5CvL4rDK07lxwyB9g6ZFTY8cxKWlDkdoMH103sHWY,2042
3
3
  src/api.py,sha256=C-Co8fjY8ewT0O5IttAX045Fhr34MuXz_YL0wT5Q0x4,4644
4
4
  src/cli.py,sha256=s11vSyouEY4Jqu6bx7QyP-jvIefpTOso-JpkpiK7Bhk,20409
5
5
  src/config.py,sha256=ANDs6EF3IQbwHyNEVWXbpnNQMEe9wDqP3Bm2w_4zTU8,13139
@@ -21,8 +21,8 @@ src/linters/nesting/typescript_analyzer.py,sha256=rec4N0NccB9mQ2452g2hcz521-kHxS
21
21
  src/orchestrator/__init__.py,sha256=XXLDJq2oaB-TpP2Y97GRnde9EkITGuFCmuLrDfxI9nY,245
22
22
  src/orchestrator/core.py,sha256=6LqaDcSBlH-hJmTpPRDTMo-tHTzEwVRQg4sZ0wyKdE0,7092
23
23
  src/orchestrator/language_detector.py,sha256=rHyVMApit80NTTNyDH1ObD1usKD8LjGmH3DwqNAWYGc,2736
24
- thailint-0.1.0.dist-info/LICENSE,sha256=kxh1J0Sb62XvhNJ6MZsVNe8PqNVJ7LHRn_EWa-T3djw,1070
25
- thailint-0.1.0.dist-info/METADATA,sha256=HUZ-YiivxAiQIKbi1zBYY08Ljq6WhDC8T5raQDFGLoU,16485
26
- thailint-0.1.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
27
- thailint-0.1.0.dist-info/entry_points.txt,sha256=l7DQJgU18sVLDpSaXOXY3lLhnQHQIRrSJZTQjG1cEAk,62
28
- thailint-0.1.0.dist-info/RECORD,,
24
+ thailint-0.1.3.dist-info/LICENSE,sha256=kxh1J0Sb62XvhNJ6MZsVNe8PqNVJ7LHRn_EWa-T3djw,1070
25
+ thailint-0.1.3.dist-info/METADATA,sha256=9eUoiPFNq3B1qnvkWGngIYMm2hUIzxYR3UcuU_e2W9c,17057
26
+ thailint-0.1.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
27
+ thailint-0.1.3.dist-info/entry_points.txt,sha256=l7DQJgU18sVLDpSaXOXY3lLhnQHQIRrSJZTQjG1cEAk,62
28
+ thailint-0.1.3.dist-info/RECORD,,