thailint 0.4.1__tar.gz → 0.4.3__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.
- {thailint-0.4.1 → thailint-0.4.3}/CHANGELOG.md +103 -0
- {thailint-0.4.1 → thailint-0.4.3}/PKG-INFO +80 -2
- {thailint-0.4.1 → thailint-0.4.3}/README.md +79 -1
- {thailint-0.4.1 → thailint-0.4.3}/pyproject.toml +1 -1
- {thailint-0.4.1 → thailint-0.4.3}/src/cli.py +277 -39
- {thailint-0.4.1 → thailint-0.4.3}/src/core/config_parser.py +31 -4
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/linter.py +15 -4
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/magic_numbers/linter.py +16 -1
- thailint-0.4.3/src/utils/project_root.py +203 -0
- thailint-0.4.1/src/utils/project_root.py +0 -84
- {thailint-0.4.1 → thailint-0.4.3}/LICENSE +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/analyzers/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/analyzers/typescript_base.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/api.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/config.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/core/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/core/base.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/core/cli_utils.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/core/linter_utils.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/core/registry.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/core/rule_discovery.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/core/types.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/core/violation_builder.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linter_config/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linter_config/ignore.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linter_config/loader.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/base_token_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/block_filter.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/block_grouper.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/cache.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/cache_query.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/config.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/config_loader.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/deduplicator.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/duplicate_storage.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/file_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/inline_ignore.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/linter.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/python_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/storage_initializer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/token_hasher.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/typescript_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/violation_builder.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/violation_filter.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/dry/violation_generator.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/config_loader.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/directory_matcher.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/path_resolver.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/pattern_matcher.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/pattern_validator.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/rule_checker.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/file_placement/violation_factory.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/magic_numbers/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/magic_numbers/config.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/magic_numbers/context_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/magic_numbers/python_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/magic_numbers/typescript_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/magic_numbers/violation_builder.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/nesting/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/nesting/config.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/nesting/linter.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/nesting/python_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/nesting/typescript_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/nesting/typescript_function_extractor.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/nesting/violation_builder.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/class_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/config.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/heuristics.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/linter.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/metrics_evaluator.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/python_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/typescript_analyzer.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/typescript_metrics_calculator.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/linters/srp/violation_builder.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/orchestrator/__init__.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/orchestrator/core.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/orchestrator/language_detector.py +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/templates/thailint_config_template.yaml +0 -0
- {thailint-0.4.1 → thailint-0.4.3}/src/utils/__init__.py +0 -0
|
@@ -24,6 +24,109 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
24
24
|
|
|
25
25
|
## [Unreleased]
|
|
26
26
|
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- **Project Root Detection System** - Three-level precedence system for accurate configuration and ignore pattern resolution
|
|
30
|
+
- `--project-root` CLI option for explicit project root specification (highest priority)
|
|
31
|
+
- Automatic project root inference from `--config` path (config's parent directory becomes project root)
|
|
32
|
+
- Auto-detection fallback that walks up from file location to find markers (`.git`, `.thailint.yaml`, `pyproject.toml`)
|
|
33
|
+
- Priority order: `--project-root` > config inference > auto-detection
|
|
34
|
+
- Click path validation (exists, is directory) with helpful error messages
|
|
35
|
+
- All paths resolved to absolute paths immediately for consistency
|
|
36
|
+
|
|
37
|
+
- **Docker Sibling Directory Support** - Solves critical Docker use case where config and code are in separate directories
|
|
38
|
+
- Explicit project root specification: `docker run -v $(pwd):/workspace thailint --project-root /workspace/root magic-numbers /workspace/backend/`
|
|
39
|
+
- Automatic config path inference: `docker run -v $(pwd):/workspace thailint --config /workspace/root/.thailint.yaml magic-numbers /workspace/backend/`
|
|
40
|
+
- Monorepo support with shared configuration across multiple projects
|
|
41
|
+
- CI/CD-friendly with explicit paths preventing auto-detection issues
|
|
42
|
+
|
|
43
|
+
- **Enhanced Configuration System**
|
|
44
|
+
- Config loading now respects project root context
|
|
45
|
+
- Ignore patterns resolve relative to project root (not file location)
|
|
46
|
+
- Config search paths: explicit `--config` > project-root/.thailint.yaml > auto-detected locations
|
|
47
|
+
- Pyprojroot fallback for test environment compatibility
|
|
48
|
+
|
|
49
|
+
- **Test Suite**
|
|
50
|
+
- 42 tests for project root detection (29 new + 13 updated, 100% passing)
|
|
51
|
+
- `tests/unit/test_cli_project_root.py` - Explicit `--project-root` tests (15 tests)
|
|
52
|
+
- `tests/unit/test_cli_config_inference.py` - Config path inference tests (14 tests)
|
|
53
|
+
- Priority order tests verifying explicit > inferred > auto-detection
|
|
54
|
+
- Error handling tests for invalid paths (doesn't exist, is file not directory)
|
|
55
|
+
- Integration tests with real directory structures
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- **CLI Commands** - All linter commands now accept `--project-root` option
|
|
60
|
+
- `thailint magic-numbers --project-root PATH [TARGET]`
|
|
61
|
+
- `thailint nesting --project-root PATH [TARGET]`
|
|
62
|
+
- `thailint srp --project-root PATH [TARGET]`
|
|
63
|
+
- `thailint file-placement --project-root PATH [TARGET]`
|
|
64
|
+
- All commands support combined usage: `--project-root` with `--config`
|
|
65
|
+
|
|
66
|
+
- **Orchestrator Initialization** - Now accepts explicit project root parameter
|
|
67
|
+
- `Orchestrator(project_root=Path, config_path=Path)` signature
|
|
68
|
+
- Project root passed from CLI to orchestrator for all linting operations
|
|
69
|
+
- Config loading uses project root context for path resolution
|
|
70
|
+
|
|
71
|
+
- **Path Resolution** - All ignore patterns resolve relative to project root
|
|
72
|
+
- Previous behavior: patterns resolved relative to file being linted
|
|
73
|
+
- New behavior: patterns resolved relative to project root directory
|
|
74
|
+
- More predictable and consistent ignore pattern matching
|
|
75
|
+
- Better Docker compatibility with volume mounts
|
|
76
|
+
|
|
77
|
+
### Documentation
|
|
78
|
+
|
|
79
|
+
- **README.md** - Added comprehensive Docker sibling directory examples
|
|
80
|
+
- "Docker with Sibling Directories" section (lines 171-207)
|
|
81
|
+
- "Docker with Sibling Directories (Advanced)" section (lines 1071-1107)
|
|
82
|
+
- Directory structure examples and use cases
|
|
83
|
+
- Priority order explanation with multiple solution approaches
|
|
84
|
+
|
|
85
|
+
- **CLI Reference** (docs/cli-reference.md)
|
|
86
|
+
- Complete `--project-root` option documentation (lines 120-170)
|
|
87
|
+
- Enhanced `--config` section explaining automatic project root inference (lines 92-118)
|
|
88
|
+
- Use case examples: Docker, monorepos, CI/CD, ignore patterns
|
|
89
|
+
- Error handling examples and exit codes
|
|
90
|
+
- Priority order documentation
|
|
91
|
+
|
|
92
|
+
- **Troubleshooting Guide** (docs/troubleshooting.md)
|
|
93
|
+
- New "Docker sibling directory structure not working" section (lines 754-856)
|
|
94
|
+
- Problem symptoms and root cause explanation
|
|
95
|
+
- Three solution approaches ranked by recommendation
|
|
96
|
+
- Debugging steps with test commands
|
|
97
|
+
- Cross-references to related documentation
|
|
98
|
+
|
|
99
|
+
- **Technical Architecture** (.ai/docs/python-cli-architecture.md)
|
|
100
|
+
- New "Project Root Detection" component documentation (section 2)
|
|
101
|
+
- Architecture diagram updated with project root detection layer
|
|
102
|
+
- Design decisions and implementation patterns
|
|
103
|
+
- Testing strategy and related components
|
|
104
|
+
- Docker use case examples and configuration integration
|
|
105
|
+
|
|
106
|
+
### Fixed
|
|
107
|
+
|
|
108
|
+
- **Docker Sibling Directory Issue** - Config and code can now be in separate, non-nested directories
|
|
109
|
+
- Previous: Only worked when code was nested under config directory
|
|
110
|
+
- Fixed: Works with any directory structure using `--project-root` or config inference
|
|
111
|
+
- Ignore patterns now resolve correctly in Docker volume mount scenarios
|
|
112
|
+
|
|
113
|
+
- **Ignore Pattern Resolution** - Patterns now resolve consistently relative to project root
|
|
114
|
+
- Previous: Resolved relative to file being linted (inconsistent behavior)
|
|
115
|
+
- Fixed: Resolved relative to project root (predictable, consistent)
|
|
116
|
+
- Especially important for Docker and monorepo scenarios
|
|
117
|
+
|
|
118
|
+
- **Test Environment Compatibility** - Added pyprojroot fallback for pytest environments
|
|
119
|
+
- Tests can run in isolated temporary directories
|
|
120
|
+
- Auto-detection gracefully handles test scenarios without project markers
|
|
121
|
+
- No impact on production code behavior
|
|
122
|
+
|
|
123
|
+
### Infrastructure
|
|
124
|
+
|
|
125
|
+
- Test suite execution time: All tests pass in <120ms (optimized for fast feedback)
|
|
126
|
+
- TDD approach: RED tests → GREEN implementation → Documentation
|
|
127
|
+
- Pre-commit hooks validated for all changes
|
|
128
|
+
- Zero regressions in existing functionality (13 existing tests updated, all passing)
|
|
129
|
+
|
|
27
130
|
## [0.2.1] - 2025-10-09
|
|
28
131
|
|
|
29
132
|
**Docker Path Validation Fix** - Fixes critical Docker image bug where file-specific linting failed due to premature path validation.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: thailint
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.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
|
|
@@ -35,7 +35,7 @@ Description-Content-Type: text/markdown
|
|
|
35
35
|
|
|
36
36
|
[](https://opensource.org/licenses/MIT)
|
|
37
37
|
[](https://www.python.org/downloads/)
|
|
38
|
-
[](tests/)
|
|
39
39
|
[](htmlcov/)
|
|
40
40
|
|
|
41
41
|
The AI Linter - Enterprise-ready linting and governance for AI-generated code across multiple languages.
|
|
@@ -201,6 +201,44 @@ docker run --rm -v $(pwd):/data \
|
|
|
201
201
|
washad/thailint:latest nesting /data/src
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
+
### Docker with Sibling Directories
|
|
205
|
+
|
|
206
|
+
For Docker environments with sibling directories (e.g., separate config and source directories), use `--project-root` or config path inference:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Directory structure:
|
|
210
|
+
# /workspace/
|
|
211
|
+
# ├── root/ # Contains .thailint.yaml and .git
|
|
212
|
+
# ├── backend/ # Code to lint
|
|
213
|
+
# └── tools/
|
|
214
|
+
|
|
215
|
+
# Option 1: Explicit project root (recommended)
|
|
216
|
+
docker run --rm -v $(pwd):/data \
|
|
217
|
+
washad/thailint:latest \
|
|
218
|
+
--project-root /data/root \
|
|
219
|
+
magic-numbers /data/backend/
|
|
220
|
+
|
|
221
|
+
# Option 2: Config path inference (automatic)
|
|
222
|
+
docker run --rm -v $(pwd):/data \
|
|
223
|
+
washad/thailint:latest \
|
|
224
|
+
--config /data/root/.thailint.yaml \
|
|
225
|
+
magic-numbers /data/backend/
|
|
226
|
+
|
|
227
|
+
# With ignore patterns resolving from project root
|
|
228
|
+
docker run --rm -v $(pwd):/data \
|
|
229
|
+
washad/thailint:latest \
|
|
230
|
+
--project-root /data/root \
|
|
231
|
+
--config /data/root/.thailint.yaml \
|
|
232
|
+
magic-numbers /data/backend/
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Priority order:**
|
|
236
|
+
1. `--project-root` (highest priority - explicit specification)
|
|
237
|
+
2. Inferred from `--config` path directory
|
|
238
|
+
3. Auto-detection from file location (fallback)
|
|
239
|
+
|
|
240
|
+
See **[Docker Usage](#docker-usage)** section below for more examples.
|
|
241
|
+
|
|
204
242
|
## Configuration
|
|
205
243
|
|
|
206
244
|
Create `.thailint.yaml` in your project root:
|
|
@@ -1033,6 +1071,8 @@ See `just --list` or `just help` for all available commands.
|
|
|
1033
1071
|
|
|
1034
1072
|
## Docker Usage
|
|
1035
1073
|
|
|
1074
|
+
### Basic Docker Commands
|
|
1075
|
+
|
|
1036
1076
|
```bash
|
|
1037
1077
|
# Pull published image
|
|
1038
1078
|
docker pull washad/thailint:latest
|
|
@@ -1061,6 +1101,44 @@ docker run --rm -v $(pwd):/data \
|
|
|
1061
1101
|
washad/thailint:latest file-placement --format json /data
|
|
1062
1102
|
```
|
|
1063
1103
|
|
|
1104
|
+
### Docker with Sibling Directories (Advanced)
|
|
1105
|
+
|
|
1106
|
+
For complex Docker setups with sibling directories, use `--project-root` for explicit control:
|
|
1107
|
+
|
|
1108
|
+
```bash
|
|
1109
|
+
# Scenario: Monorepo with separate config and code directories
|
|
1110
|
+
# Directory structure:
|
|
1111
|
+
# /workspace/
|
|
1112
|
+
# ├── config/ # Contains .thailint.yaml
|
|
1113
|
+
# ├── backend/app/ # Python backend code
|
|
1114
|
+
# ├── frontend/ # TypeScript frontend
|
|
1115
|
+
# └── tools/ # Build tools
|
|
1116
|
+
|
|
1117
|
+
# Explicit project root (recommended for Docker)
|
|
1118
|
+
docker run --rm -v /path/to/workspace:/workspace \
|
|
1119
|
+
washad/thailint:latest \
|
|
1120
|
+
--project-root /workspace/config \
|
|
1121
|
+
magic-numbers /workspace/backend/
|
|
1122
|
+
|
|
1123
|
+
# Config path inference (automatic - no --project-root needed)
|
|
1124
|
+
docker run --rm -v /path/to/workspace:/workspace \
|
|
1125
|
+
washad/thailint:latest \
|
|
1126
|
+
--config /workspace/config/.thailint.yaml \
|
|
1127
|
+
magic-numbers /workspace/backend/
|
|
1128
|
+
|
|
1129
|
+
# Lint multiple sibling directories with shared config
|
|
1130
|
+
docker run --rm -v /path/to/workspace:/workspace \
|
|
1131
|
+
washad/thailint:latest \
|
|
1132
|
+
--project-root /workspace/config \
|
|
1133
|
+
nesting /workspace/backend/ /workspace/frontend/
|
|
1134
|
+
```
|
|
1135
|
+
|
|
1136
|
+
**When to use `--project-root` in Docker:**
|
|
1137
|
+
- **Sibling directory structures** - When config/code aren't nested
|
|
1138
|
+
- **Monorepos** - Multiple projects sharing one config
|
|
1139
|
+
- **CI/CD** - Explicit paths prevent auto-detection issues
|
|
1140
|
+
- **Ignore patterns** - Ensures patterns resolve from correct base directory
|
|
1141
|
+
|
|
1064
1142
|
## Documentation
|
|
1065
1143
|
|
|
1066
1144
|
### Comprehensive Guides
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
4
|
[](https://www.python.org/downloads/)
|
|
5
|
-
[](tests/)
|
|
6
6
|
[](htmlcov/)
|
|
7
7
|
|
|
8
8
|
The AI Linter - Enterprise-ready linting and governance for AI-generated code across multiple languages.
|
|
@@ -168,6 +168,44 @@ docker run --rm -v $(pwd):/data \
|
|
|
168
168
|
washad/thailint:latest nesting /data/src
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
+
### Docker with Sibling Directories
|
|
172
|
+
|
|
173
|
+
For Docker environments with sibling directories (e.g., separate config and source directories), use `--project-root` or config path inference:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Directory structure:
|
|
177
|
+
# /workspace/
|
|
178
|
+
# ├── root/ # Contains .thailint.yaml and .git
|
|
179
|
+
# ├── backend/ # Code to lint
|
|
180
|
+
# └── tools/
|
|
181
|
+
|
|
182
|
+
# Option 1: Explicit project root (recommended)
|
|
183
|
+
docker run --rm -v $(pwd):/data \
|
|
184
|
+
washad/thailint:latest \
|
|
185
|
+
--project-root /data/root \
|
|
186
|
+
magic-numbers /data/backend/
|
|
187
|
+
|
|
188
|
+
# Option 2: Config path inference (automatic)
|
|
189
|
+
docker run --rm -v $(pwd):/data \
|
|
190
|
+
washad/thailint:latest \
|
|
191
|
+
--config /data/root/.thailint.yaml \
|
|
192
|
+
magic-numbers /data/backend/
|
|
193
|
+
|
|
194
|
+
# With ignore patterns resolving from project root
|
|
195
|
+
docker run --rm -v $(pwd):/data \
|
|
196
|
+
washad/thailint:latest \
|
|
197
|
+
--project-root /data/root \
|
|
198
|
+
--config /data/root/.thailint.yaml \
|
|
199
|
+
magic-numbers /data/backend/
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Priority order:**
|
|
203
|
+
1. `--project-root` (highest priority - explicit specification)
|
|
204
|
+
2. Inferred from `--config` path directory
|
|
205
|
+
3. Auto-detection from file location (fallback)
|
|
206
|
+
|
|
207
|
+
See **[Docker Usage](#docker-usage)** section below for more examples.
|
|
208
|
+
|
|
171
209
|
## Configuration
|
|
172
210
|
|
|
173
211
|
Create `.thailint.yaml` in your project root:
|
|
@@ -1000,6 +1038,8 @@ See `just --list` or `just help` for all available commands.
|
|
|
1000
1038
|
|
|
1001
1039
|
## Docker Usage
|
|
1002
1040
|
|
|
1041
|
+
### Basic Docker Commands
|
|
1042
|
+
|
|
1003
1043
|
```bash
|
|
1004
1044
|
# Pull published image
|
|
1005
1045
|
docker pull washad/thailint:latest
|
|
@@ -1028,6 +1068,44 @@ docker run --rm -v $(pwd):/data \
|
|
|
1028
1068
|
washad/thailint:latest file-placement --format json /data
|
|
1029
1069
|
```
|
|
1030
1070
|
|
|
1071
|
+
### Docker with Sibling Directories (Advanced)
|
|
1072
|
+
|
|
1073
|
+
For complex Docker setups with sibling directories, use `--project-root` for explicit control:
|
|
1074
|
+
|
|
1075
|
+
```bash
|
|
1076
|
+
# Scenario: Monorepo with separate config and code directories
|
|
1077
|
+
# Directory structure:
|
|
1078
|
+
# /workspace/
|
|
1079
|
+
# ├── config/ # Contains .thailint.yaml
|
|
1080
|
+
# ├── backend/app/ # Python backend code
|
|
1081
|
+
# ├── frontend/ # TypeScript frontend
|
|
1082
|
+
# └── tools/ # Build tools
|
|
1083
|
+
|
|
1084
|
+
# Explicit project root (recommended for Docker)
|
|
1085
|
+
docker run --rm -v /path/to/workspace:/workspace \
|
|
1086
|
+
washad/thailint:latest \
|
|
1087
|
+
--project-root /workspace/config \
|
|
1088
|
+
magic-numbers /workspace/backend/
|
|
1089
|
+
|
|
1090
|
+
# Config path inference (automatic - no --project-root needed)
|
|
1091
|
+
docker run --rm -v /path/to/workspace:/workspace \
|
|
1092
|
+
washad/thailint:latest \
|
|
1093
|
+
--config /workspace/config/.thailint.yaml \
|
|
1094
|
+
magic-numbers /workspace/backend/
|
|
1095
|
+
|
|
1096
|
+
# Lint multiple sibling directories with shared config
|
|
1097
|
+
docker run --rm -v /path/to/workspace:/workspace \
|
|
1098
|
+
washad/thailint:latest \
|
|
1099
|
+
--project-root /workspace/config \
|
|
1100
|
+
nesting /workspace/backend/ /workspace/frontend/
|
|
1101
|
+
```
|
|
1102
|
+
|
|
1103
|
+
**When to use `--project-root` in Docker:**
|
|
1104
|
+
- **Sibling directory structures** - When config/code aren't nested
|
|
1105
|
+
- **Monorepos** - Multiple projects sharing one config
|
|
1106
|
+
- **CI/CD** - Explicit paths prevent auto-detection issues
|
|
1107
|
+
- **Ignore patterns** - Ensures patterns resolve from correct base directory
|
|
1108
|
+
|
|
1031
1109
|
## Documentation
|
|
1032
1110
|
|
|
1033
1111
|
### Comprehensive Guides
|
|
@@ -17,7 +17,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
17
17
|
|
|
18
18
|
[tool.poetry]
|
|
19
19
|
name = "thailint"
|
|
20
|
-
version = "0.4.
|
|
20
|
+
version = "0.4.3"
|
|
21
21
|
description = "The AI Linter - Enterprise-grade linting and governance for AI-generated code across multiple languages"
|
|
22
22
|
authors = ["Steve Jackson"]
|
|
23
23
|
license = "MIT"
|