diagnose
Output machine-readable diagnostics for Calor files.
Bash
calor diagnose <files...> [options]Overview
The diagnose command analyzes Calor files and outputs diagnostics in formats suitable for tooling integration:
- Text - Human-readable plain text
- JSON - Machine-readable structured data
- SARIF - Static Analysis Results Interchange Format for IDE/CI integration
Quick Start
Bash
# Diagnose a single file (text output)
calor diagnose MyModule.calr
# JSON output for processing
calor diagnose MyModule.calr --format json
# SARIF output for IDE integration
calor diagnose src/*.calr --format sarif --output diagnostics.sarif
# Enable strict checking
calor diagnose MyModule.calr --strict-api --require-docsOptions
| Option | Short | Default | Description |
|---|---|---|---|
--format | -f | text | Output format: text, json, or sarif |
--output | -o | stdout | Output file (stdout if not specified) |
--strict-api | false | Enable strict API checking | |
--require-docs | false | Require documentation on public functions |
Output Formats
Text (Default)
Plain Text
Calculator.calr:12:5: error: Undefined variable 'x'
§R (+ x 1)
^
Summary: 1 error, 1 warning, 1 infoJSON
Machine-readable format for automated processing.
SARIF
Integrates with VS Code, GitHub Code Scanning, Azure DevOps, and other SARIF-compatible tools.
Exit Codes
| Code | Meaning |
|---|---|
0 | No errors |
1 | One or more errors found |
2 | Processing error |
CI/CD Integration
YAML
# GitHub Actions
- name: Check Calor diagnostics
run: calor diagnose src/**/*.calr --format sarif --output calor.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: calor.sarifSee Also
- calor format - Format Calor source files
- calor compile - Compile with error reporting