cirron lint
Comprehensive project validation and code quality checking for ML projects: analyzes structure, configuration, dependencies, and code to surface issues and best-practice violations.Usage
Options
| Option | Description | Default |
|---|---|---|
--config | Lint project configuration (cirron.yaml) | false |
--structure | Check project structure and files | false |
--dependencies | Validate requirements.txt | false |
--code | Run code quality checks | false |
--all | Run all linting checks | true |
--fix | Automatically fix fixable issues | false |
--verbose | Show detailed suggestions | false |
--json | Output results in JSON format | false |
--strict | Treat warnings as errors | false |
Validation Rules
| Category | Rule | What it checks | Severity |
|---|---|---|---|
| config | Required fields | name, version, template present in cirron.yaml | error |
| config | JSON syntax | Valid JSON/YAML structure | error |
| config | Version format | Semantic versioning compliance | warning |
| config | Framework config | Framework-specific requirements (PyTorch needs Python version, TensorFlow GPU flags) | warning |
| config | Environment setup | Deployment environment configurations declared | warning |
| structure | Required files | src/model.py, requirements.txt, Dockerfile exist | error |
| structure | Optional files | src/inference.py, src/data_loader.py, tests/ | info |
| structure | ML directories | models/, data/, checkpoints/, logs/ exist | warning |
| structure | .cirronignore | Ignore file present | warning |
| dependencies | requirements.txt | File exists and is parseable | error |
| dependencies | Version pinning | Dependencies have version constraints | warning |
| dependencies | ML libraries | Detects common ML libraries (torch, tensorflow, sklearn, numpy, pandas) | info |
| code | TypeScript/JS | Runs npm run lint (ESLint) | error |
| code | Python syntax | py_compile on source files | error |
| code | Python style | Lint via flake8/pylint if present | warning |
| code | ML patterns | Model definition follows framework conventions | warning |
Automatic Fixes
--fix resolves: missing ML directories (created), missing .cirronignore (generated from a template), ESLint auto-fixable code issues, and basic structural reorganization.
The generated .cirronignore template covers .git/, large data files (data/raw/, *.csv), model artifacts (*.pth, *.pkl), dev caches (.vscode/, .idea/, __pycache__/, *.pyc), logs, temp files, and build outputs.
Examples
Recommended Project Structure
Integration
Troubleshooting
| Error | Resolution |
|---|---|
npm run lint failed | Install ESLint: npm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin |
Python syntax error in src/model.py | python -m py_compile src/model.py |
Missing requirements.txt | pip freeze > requirements.txt |
.cirronignore to exclude large data and model artifacts from linting. Pin dependency versions for reproducible builds and follow framework conventions in src/model.py.