Papyrus Lint CLI report
The JSON document emitted by PapyrusLinterCLI --json.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://papyrus-lint.idrinth.de/schema/papyrus-lint-report.schema.json",
"title": "Papyrus Lint CLI report",
"description": "The JSON document emitted by PapyrusLinterCLI --json.",
"type": "object",
"additionalProperties": false,
"required": [
"files",
"scripts_checked",
"files_with_diagnostics",
"total_diagnostics",
"files_fixed",
"dry_run",
"success"
],
"properties": {
"files": {
"description": "Every resolved Papyrus script, including scripts with no diagnostics.",
"type": "array",
"items": {
"$ref": "#/$defs/fileReport"
}
},
"scripts_checked": {
"description": "The number of resolved Papyrus scripts checked by this run.",
"type": "integer",
"minimum": 0
},
"files_with_diagnostics": {
"description": "The number of checked scripts that produced at least one diagnostic.",
"type": "integer",
"minimum": 0
},
"total_diagnostics": {
"description": "The total number of diagnostics across all files.",
"type": "integer",
"minimum": 0
},
"files_fixed": {
"description": "The number of scripts changed (or, under --dry-run, that would have been changed) by automatic fixes, or null when the fix subcommand was not used.",
"type": [
"integer",
"null"
],
"minimum": 0
},
"dry_run": {
"description": "Whether this run was fix --dry-run: no file was written, and each changed script's diff shows what would have changed instead.",
"type": "boolean"
},
"success": {
"description": "Whether the lint result exits successfully under the configured failure thresholds.",
"type": "boolean"
}
},
"$defs": {
"fileReport": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"diagnostics",
"parser_errors",
"diff"
],
"properties": {
"path": {
"description": "The resolved script path as displayed by the CLI.",
"type": "string",
"minLength": 1
},
"diagnostics": {
"description": "The diagnostics reported for this script, or an empty array when it is clean.",
"type": "array",
"items": {
"$ref": "#/$defs/diagnostic"
}
},
"parser_errors": {
"description": "Errors the lexer or parser raised while handling this script. Empty when the script lexed and parsed cleanly. Currently at most one entry, because parsing stops at the first error.",
"type": "array",
"items": {
"$ref": "#/$defs/parserError"
}
},
"diff": {
"description": "The standard unified diff between this script's original source and what fix would have written, or null unless run with fix --dry-run and this script would actually have changed.",
"type": [
"string",
"null"
]
}
}
},
"parserError": {
"description": "One error raised while lexing or parsing this script.",
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"line",
"column",
"message"
],
"properties": {
"kind": {
"description": "Whether this error came from the lexer or the recursive-descent parser.",
"type": "string",
"enum": [
"lex",
"parse"
]
},
"line": {
"description": "The 1-indexed source line where the error was detected.",
"type": "integer",
"minimum": 1
},
"column": {
"description": "The 1-indexed source column where the error was detected.",
"type": "integer",
"minimum": 1
},
"message": {
"description": "The human-readable parser or lexer error message.",
"type": "string",
"minLength": 1
}
}
},
"diagnostic": {
"type": "object",
"additionalProperties": false,
"required": [
"line",
"column",
"rule",
"level",
"message",
"doc_url"
],
"properties": {
"line": {
"description": "The 1-indexed source line where the diagnostic starts.",
"type": "integer",
"minimum": 1
},
"column": {
"description": "The 1-indexed source column where the diagnostic starts.",
"type": "integer",
"minimum": 1
},
"rule": {
"description": "The stable, hyphenated identifier of the lint rule.",
"type": "string",
"minLength": 1,
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"level": {
"description": "The diagnostic severity. Untagged external diagnostics are classified as errors.",
"type": "string",
"enum": [
"error",
"warning",
"info"
]
},
"message": {
"description": "The human-readable diagnostic message, including its severity prefix when classified.",
"type": "string",
"minLength": 1
},
"doc_url": {
"description": "This rule's own documentation link on the project website, so a consumer can jump straight to its explanation, or null for a rule with no known tag metadata (e.g. a compiler-reported diagnostic).",
"type": [
"string",
"null"
],
"format": "uri"
}
}
}
}
}