Lint Json Schema
DocBuilder’s linter supports machine-readable JSON output for CI/CD integration, automated reporting, and tooling integration.
Usage
Schema Definition
Root Object
Field Descriptions
Root Fields
| Field | Type | Description |
|---|---|---|
version |
string | Schema version (semver format) |
timestamp |
string | ISO 8601 timestamp of lint execution |
path |
string | Path that was linted |
auto_detected |
boolean | Whether the path was auto-detected (vs. explicitly provided) |
summary |
object | Summary statistics (see below) |
issues |
array | List of lint issues found (see below) |
broken_links |
array | List of broken links detected (see below) |
exit_code |
integer | Exit code: 0 (success), 1 (warnings), 2 (errors) |
Summary Object
| Field | Type | Description |
|---|---|---|
total_files |
integer | Total number of files scanned |
errors |
integer | Number of files with errors (blocks build) |
warnings |
integer | Number of files with warnings |
passed |
integer | Number of files that passed all checks |
Invariant: errors + warnings + passed = total_files
Issue Object
| Field | Type | Required | Description |
|---|---|---|---|
file |
string | ✅ | Relative path to the file with the issue |
line |
integer | ✅ | Line number (0 for file-level issues) |
column |
integer | ✅ | Column number (0 for file-level issues) |
severity |
string | ✅ | "error" or "warning" |
rule |
string | ✅ | Rule identifier (e.g., "filename-convention") |
message |
string | ✅ | Human-readable error message |
suggestion |
string | ❌ | Suggested fix (if applicable) |
context |
object | ❌ | Additional context about the issue |
Broken Link Object
| Field | Type | Required | Description |
|---|---|---|---|
source_file |
string | ✅ | File containing the broken link |
line |
integer | ✅ | Line number where link appears |
link_text |
string | ✅ | Display text of the link |
target |
string | ✅ | Target URL/path that is broken |
link_type |
string | ✅ | Type: "inline", "reference", "image" |
error |
string | ✅ | Description of why link is broken |
Rule Identifiers
Current rules that may appear in the rule field:
| Rule ID | Description | Severity |
|---|---|---|
filename-convention |
Filename violates naming conventions | error |
missing-title |
Frontmatter missing required title field |
warning |
broken-links |
Internal link target does not exist | error |
invalid-extension |
File extension not in whitelist | error |
Examples
Success (No Issues)
Errors Found
Parsing Examples
Shell (jq)
Python
JavaScript/Node.js
Go
Version History
v1.0 (Current)
Initial JSON schema with:
- Basic issue reporting
- Broken link detection
- Summary statistics
- Exit code reporting
Planned Enhancements
Future versions may include:
fixes_availablefield indicating which issues can be auto-fixedperformancemetrics (files/second, total time)rules_appliedlist of rules that were checked- JUnit XML output format for better CI integration
- SARIF (Static Analysis Results Interchange Format) support
Integration Tips
CI/CD Best Practices
-
Always capture JSON output even on failure:
-
Upload as artifact for debugging:
-
Parse before failing pipeline to provide better feedback:
-
Rate-limit PR comments to avoid spam on large changes
-
Cache results for incremental linting on large repositories
Tooling Integration
The JSON output is designed to integrate with:
- Code review tools: GitHub Actions, GitLab CI, BitBucket Pipelines
- IDE extensions: VS Code, IntelliJ, Vim/NeoVim
- Quality dashboards: SonarQube, CodeClimate
- Slack/Discord bots: Automated team notifications
- Documentation portals: Link to specific issues in docs
Schema Stability
This schema follows semantic versioning:
- Major version changes indicate breaking changes
- Minor version changes add new fields (backward compatible)
- Patch version changes are documentation/clarification only
The version field in the JSON output reflects the schema version, not the DocBuilder version.
[lint-json-schema](https://docs.home.luguber.info/_uid/29426dd7-62c7-4e24-8378-5487c13fbee7/)