Papyrus Lint Export for AI document
The JSON document downloaded by the desktop app's Export for AI feature. It contains the currently filtered lint findings and metadata for each recognized rule represented in those findings.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://papyrus-lint.idrinth.de/schema/papyrus-lint-ai-export.v1.schema.json",
"title": "Papyrus Lint Export for AI document",
"description": "The JSON document downloaded by the desktop app's Export for AI feature. It contains the currently filtered lint findings and metadata for each recognized rule represented in those findings.",
"type": "object",
"additionalProperties": false,
"required": [
"$schema",
"header",
"configuration",
"findings",
"rule_details"
],
"properties": {
"$schema": {
"description": "The canonical JSON Schema for validating and interpreting this AI export document.",
"const": "https://papyrus-lint.idrinth.de/schema/papyrus-lint-ai-export.v1.schema.json"
},
"header": {
"$ref": "#/$defs/header"
},
"configuration": {
"description": "The fully resolved lint configuration used to produce the findings, including defaults for settings omitted from the project's YAML file.",
"$ref": "#/$defs/configuration"
},
"findings": {
"$ref": "#/$defs/findingsReport"
},
"rule_details": {
"description": "Tag metadata for each recognized rule represented in findings. Triggered rule ids for which Papyrus Lint has no metadata are omitted.",
"type": "array",
"items": {
"$ref": "#/$defs/ruleDetail"
}
}
},
"$defs": {
"configuration": {
"type": "object",
"additionalProperties": false,
"required": [
"semicolon",
"indentation",
"indentation_width",
"identifier_casing",
"cyclomatic_complexity_warning",
"cyclomatic_complexity_error",
"type_casing",
"named_arguments",
"min_wait_interval",
"magic_numbers",
"fail_on_warning",
"fail_on_info",
"bool_like_int",
"assume_auto_properties_filled",
"rules"
],
"properties": {
"semicolon": {
"type": "boolean"
},
"indentation": {
"type": "string",
"enum": [
"tab",
"space"
]
},
"indentation_width": {
"type": "integer",
"minimum": 0
},
"identifier_casing": {
"type": "string",
"enum": [
"camelCase",
"PascalCase",
"snake_case",
"CONSTANT_CASE"
]
},
"cyclomatic_complexity_warning": {
"type": "integer",
"minimum": 0
},
"cyclomatic_complexity_error": {
"type": "integer",
"minimum": 0
},
"type_casing": {
"type": "string",
"enum": [
"PascalCase",
"camelCase",
"lowercase",
"UPPERCASE"
]
},
"named_arguments": {
"type": "string",
"enum": [
"always",
"instead_of_defaults",
"never"
]
},
"min_wait_interval": {
"type": "number",
"minimum": 0
},
"magic_numbers": {
"type": "string",
"enum": [
"loose",
"strict"
]
},
"fail_on_warning": {
"type": "boolean"
},
"fail_on_info": {
"type": "boolean"
},
"bool_like_int": {
"type": "boolean"
},
"assume_auto_properties_filled": {
"type": "boolean"
},
"rules": {
"$ref": "#/$defs/rules"
}
}
},
"rules": {
"type": "object",
"additionalProperties": false,
"required": [
"trailing_whitespace",
"comma_spacing",
"forbidden_functions",
"formid_hex_notation",
"slow_functions",
"unused_getter",
"unused_nodiscard",
"unused_property",
"semicolon",
"float_int_conversion",
"int_division_to_float",
"strict_boolean",
"argument_types",
"return_types",
"function_override",
"argument_naming",
"numeric_comparison",
"indentation",
"cyclomatic_complexity",
"unreachable_statement",
"static_condition",
"division_by_zero",
"empty_body",
"unused_local_variable",
"variable_used_before_assignment",
"none_form_usage",
"local_variable_shadowing",
"parameter_reassignment",
"chain_whitespace",
"exclamation_spacing",
"identifier_casing",
"type_casing",
"named_arguments",
"operator_spacing",
"property_sorting",
"explicit_return",
"unchecked_form_parameter",
"unchecked_cast",
"useless_downcast",
"unresolved_script",
"non_global_function_call",
"static_function_call_via_instance",
"short_wait_interval",
"state_function_signature",
"goto_state",
"too_many_states",
"multiple_auto_states",
"conflicting_script_versions",
"unused_disable",
"magic_numbers",
"native_function_usage",
"repeated_getvalue",
"global_variable_setvalue",
"global_variable_increment",
"invariant_loop_condition",
"script_name_collision",
"array_bounds",
"readonly_property_write",
"default_property_value",
"unguarded_self_recursion",
"self_assignment"
],
"properties": {
"trailing_whitespace": {
"type": "boolean"
},
"comma_spacing": {
"type": "boolean"
},
"forbidden_functions": {
"type": "boolean"
},
"formid_hex_notation": {
"type": "boolean"
},
"slow_functions": {
"type": "boolean"
},
"unused_getter": {
"type": "boolean"
},
"unused_nodiscard": {
"type": "boolean"
},
"unused_property": {
"type": "boolean"
},
"semicolon": {
"type": "boolean"
},
"float_int_conversion": {
"type": "boolean"
},
"int_division_to_float": {
"type": "boolean"
},
"strict_boolean": {
"type": "boolean"
},
"argument_types": {
"type": "boolean"
},
"return_types": {
"type": "boolean"
},
"function_override": {
"type": "boolean"
},
"argument_naming": {
"type": "boolean"
},
"numeric_comparison": {
"type": "boolean"
},
"indentation": {
"type": "boolean"
},
"cyclomatic_complexity": {
"type": "boolean"
},
"unreachable_statement": {
"type": "boolean"
},
"static_condition": {
"type": "boolean"
},
"division_by_zero": {
"type": "boolean"
},
"empty_body": {
"type": "boolean"
},
"unused_local_variable": {
"type": "boolean"
},
"variable_used_before_assignment": {
"type": "boolean"
},
"none_form_usage": {
"type": "boolean"
},
"local_variable_shadowing": {
"type": "boolean"
},
"parameter_reassignment": {
"type": "boolean"
},
"chain_whitespace": {
"type": "boolean"
},
"exclamation_spacing": {
"type": "boolean"
},
"identifier_casing": {
"type": "boolean"
},
"type_casing": {
"type": "boolean"
},
"named_arguments": {
"type": "boolean"
},
"operator_spacing": {
"type": "boolean"
},
"property_sorting": {
"type": "boolean"
},
"explicit_return": {
"type": "boolean"
},
"unchecked_form_parameter": {
"type": "boolean"
},
"unchecked_cast": {
"type": "boolean"
},
"useless_downcast": {
"type": "boolean"
},
"unresolved_script": {
"type": "boolean"
},
"non_global_function_call": {
"type": "boolean"
},
"static_function_call_via_instance": {
"type": "boolean"
},
"short_wait_interval": {
"type": "boolean"
},
"state_function_signature": {
"type": "boolean"
},
"goto_state": {
"type": "boolean"
},
"too_many_states": {
"type": "boolean"
},
"multiple_auto_states": {
"type": "boolean"
},
"conflicting_script_versions": {
"type": "boolean"
},
"unused_disable": {
"type": "boolean"
},
"magic_numbers": {
"type": "boolean"
},
"native_function_usage": {
"type": "boolean"
},
"repeated_getvalue": {
"type": "boolean"
},
"global_variable_setvalue": {
"type": "boolean"
},
"global_variable_increment": {
"type": "boolean"
},
"invariant_loop_condition": {
"type": "boolean"
},
"script_name_collision": {
"type": "boolean"
},
"array_bounds": {
"type": "boolean"
},
"readonly_property_write": {
"type": "boolean"
},
"default_property_value": {
"type": "boolean"
},
"unguarded_self_recursion": {
"type": "boolean"
},
"self_assignment": {
"type": "boolean"
}
}
},
"header": {
"type": "object",
"additionalProperties": false,
"required": [
"tool",
"version",
"website",
"target_game",
"generated_at"
],
"properties": {
"tool": {
"description": "The application that produced this document.",
"const": "Papyrus Lint"
},
"version": {
"description": "The running desktop app's version, or `unknown` when it could not be read.",
"type": "string",
"minLength": 1
},
"website": {
"description": "The Papyrus Lint website, where additional rule and configuration documentation is available.",
"type": "string"
},
"target_game": {
"description": "The Papyrus dialect/engine these findings and rule details were produced for. Papyrus Lint has no per-project game/edition setting, so this is fixed.",
"const": "Skyrim SE/AE"
},
"generated_at": {
"description": "The UTC date and time at which this export was generated, in RFC 3339 format.",
"type": "string",
"format": "date-time"
}
}
},
"findingsReport": {
"description": "The filtered findings, in the same shape as the desktop app's Export issues JSON report.",
"type": "object",
"additionalProperties": false,
"required": [
"files",
"files_with_diagnostics",
"total_diagnostics"
],
"properties": {
"files": {
"type": "array",
"items": {
"$ref": "#/$defs/fileReport"
}
},
"files_with_diagnostics": {
"description": "The number of exported files that have at least one diagnostic.",
"type": "integer",
"minimum": 0
},
"total_diagnostics": {
"description": "The total number of exported diagnostics across all files.",
"type": "integer",
"minimum": 0
}
}
},
"fileReport": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"diagnostics",
"source"
],
"properties": {
"path": {
"description": "The script path relative to the currently loaded project when possible.",
"type": "string",
"minLength": 1
},
"diagnostics": {
"description": "The diagnostics for this script that passed every active results filter.",
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/diagnostic"
}
},
"source": {
"description": "This script's current on-disk contents, letting the assistant see the code each diagnostic refers to without the project open; an error message describing why it couldn't be read (e.g. it was moved or deleted since linting); or null when no source was attached at all.",
"type": [
"string",
"null"
]
}
}
},
"diagnostic": {
"type": "object",
"additionalProperties": false,
"required": [
"line",
"column",
"rule",
"level",
"message"
],
"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 lint rule id, or `unknown` for a diagnostic without one.",
"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.",
"type": "string",
"minLength": 1
},
"repair": {
"description": "What this diagnostic's line would look like after applying its rule's automatic fix, present only for a diagnostic whose rule is auto-fixable (see rule_details) and only when Papyrus Lint could compute one. Omitted for a rule with no automatic fix, for a finding that fix wouldn't actually change (e.g. type-casing's own \"no automatic fix\" case), or when the fix would shift the file's line count elsewhere (e.g. property-sorting relocating a property's declaration).",
"type": "string",
"minLength": 1
}
}
},
"ruleDetail": {
"type": "object",
"additionalProperties": false,
"required": [
"rule",
"description",
"kinds",
"importance",
"auto_fixable"
],
"properties": {
"rule": {
"description": "The stable, hyphenated identifier of the lint rule.",
"type": "string",
"minLength": 1,
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"description": {
"description": "The rule's detailed description, copied from its row in the project README's Implemented Lints tables.",
"type": "string",
"minLength": 1
},
"kinds": {
"description": "The classes of issue this rule detects.",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"style",
"performance",
"correctness",
"maintainability"
]
}
},
"importance": {
"description": "The rule's relative importance.",
"type": "string",
"enum": [
"low",
"medium",
"high"
]
},
"auto_fixable": {
"description": "Whether Papyrus Lint can automatically fix this rule's findings.",
"type": "boolean"
}
}
}
}
}