docs(arch): integrate architecture validation into QA workflow

- Add arch-check, arch-check-file, arch-check-object Makefile targets
- Include arch-check in QA target for CI integration
- Update architecture-rules.md with CLI usage examples
- Update code-quality.md with validation commands

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-03 21:31:41 +01:00
parent 69aff0ca30
commit 96bdb07fb2
3 changed files with 131 additions and 9 deletions

View File

@@ -12,18 +12,60 @@ The architecture validator ensures consistent patterns, separation of concerns,
## Running the Validator
### Using Make Commands (Recommended)
```bash
# Check all files
make arch-check
# Check a single file
make arch-check-file file="app/api/v1/admin/vendors.py"
# Check all files related to an entity (company, vendor, user, etc.)
make arch-check-object name="company"
make arch-check-object name="vendor"
# Full QA (includes arch-check)
make qa
```
### Using Python Directly
```bash
# Check all files
python scripts/validate_architecture.py
# Check specific directory
python scripts/validate_architecture.py app/api/
python scripts/validate_architecture.py -d app/api/
# Check a single file
python scripts/validate_architecture.py -f app/api/v1/admin/vendors.py
# Check all files for an entity
python scripts/validate_architecture.py -o company
python scripts/validate_architecture.py -o vendor
# Verbose output
python scripts/validate_architecture.py --verbose
# Auto-fix where possible
python scripts/validate_architecture.py --fix
# JSON output (for CI/CD)
python scripts/validate_architecture.py --json
```
### Output Format
The validator displays a summary table for validated files:
```
📋 FILE SUMMARY:
--------------------------------------------------------------------------------
File Status Errors Warnings
----------------------------- -------- ------- --------
app/api/v1/admin/companies.py ❌ FAILED 6 9
app/services/company_service.py ✅ PASSED 0 0
models/database/company.py ✅ PASSED 0 0
--------------------------------------------------------------------------------
Total: 3 files | ✅ 2 passed | ❌ 1 failed | 6 errors | 9 warnings
```
## Severity Levels