← All docs

Papyrus Lint project configuration

A papyrus-lint.yaml / papyrus-lint.yml file at a project root. Every key is optional; omitted keys fall back to the defaults documented here and in the generated shared/configuration/papyrus-lint.default.yaml artifact. The loader currently ignores unknown keys, but this schema sets additionalProperties to false so editors can flag typos.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://papyrus-lint.idrinth.de/schema/papyrus-lint.schema.json",
  "title": "Papyrus Lint project configuration",
  "description": "A papyrus-lint.yaml / papyrus-lint.yml file at a project root. Every key is optional; omitted keys fall back to the defaults documented here and in the generated shared/configuration/papyrus-lint.default.yaml artifact. The loader currently ignores unknown keys, but this schema sets additionalProperties to false so editors can flag typos.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "game": {
      "description": "Game whose Papyrus dialect and runtime APIs the project targets.",
      "type": "string",
      "enum": [
        "skyrim",
        "legacy",
        "fallout4",
        "starfield"
      ],
      "default": "skyrim"
    },
    "compiler_path": {
      "description": "Path to PapyrusCompiler.exe, or null/omit to auto-detect it.",
      "type": [
        "string",
        "null"
      ],
      "default": null
    },
    "additional_script_roots": {
      "description": "Extra directories (relative to the project root, or absolute) to search for .psc files, besides scripts/source and source/scripts. Used for linting, cross-script resolution, and the compiler -i path.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "default": []
    },
    "lookup_script_roots": {
      "description": "Extra directories searched only as a fallback when resolving other scripts for analysis (argument/return types, Extends, autocompletion). Scripts found only here are never linted, and these directories are ignored by conflicting-script-versions.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "default": []
    },
    "compile_check": {
      "description": "Also run PapyrusCompiler.exe (into a throwaway temporary directory) as part of linting a .psc, reporting its errors alongside the lint engine. Requires compiler_path to be set or auto-detected.",
      "type": "boolean",
      "default": false
    },
    "strict_achlist_scope": {
      "description": "When true, restrict cross-script resolution and conflicting-script-versions to an achlist's listed entries only. When false (the default), parent directories of listed entries are also search roots.",
      "type": "boolean",
      "default": false
    },
    "semicolon": {
      "description": "Whether lines are required to end in a semicolon (true) or must not (false).",
      "type": "boolean",
      "default": false
    },
    "indentation": {
      "description": "Expected indentation style, read by the indentation lint and automatic fix.",
      "type": "string",
      "enum": [
        "tab",
        "space"
      ],
      "default": "tab"
    },
    "indentation_width": {
      "description": "Spaces per indentation level. Used only when indentation is space. The engine clamps this to 1..16.",
      "type": "integer",
      "minimum": 1,
      "maximum": 16,
      "default": 4
    },
    "max_line_length": {
      "description": "Non-negative integer; maximum characters allowed on one line",
      "type": "integer",
      "minimum": 0,
      "default": 120
    },
    "type_casing": {
      "description": "Casing convention for a script's declared type name (the identifier following ScriptName).",
      "type": "string",
      "enum": [
        "PascalCase",
        "camelCase",
        "lowercase",
        "UPPERCASE"
      ],
      "default": "PascalCase"
    },
    "identifier_casing": {
      "description": "Casing style declared identifiers must match (functions, events, properties, states, parameters, locals).",
      "type": "string",
      "enum": [
        "camelCase",
        "PascalCase",
        "snake_case",
        "CONSTANT_CASE"
      ],
      "default": "PascalCase"
    },
    "hungarian": {
      "description": "Whether the Hungarian-prefix lint requires type prefixes (allow) or flags them (forbid). The rule itself stays off unless rules.hungarian_prefix is enabled.",
      "type": "string",
      "enum": [
        "allow",
        "forbid"
      ],
      "default": "allow"
    },
    "named_arguments": {
      "description": "How strongly a positional call argument should be passed by name instead.",
      "type": "string",
      "enum": [
        "always",
        "instead_of_defaults",
        "never"
      ],
      "default": "never"
    },
    "magic_numbers": {
      "description": "Whether the magic-numbers lint also flags Wait/RegisterFor* interval arguments (strict) or leaves them unflagged (loose).",
      "type": "string",
      "enum": [
        "loose",
        "strict"
      ],
      "default": "loose"
    },
    "cyclomatic_complexity_warning": {
      "description": "Cyclomatic complexity at which the cyclomatic-complexity lint reports a warning.",
      "type": "integer",
      "minimum": 0,
      "default": 10
    },
    "cyclomatic_complexity_error": {
      "description": "Cyclomatic complexity at which the cyclomatic-complexity lint reports an error. A value below cyclomatic_complexity_warning is treated as equal to it.",
      "type": "integer",
      "minimum": 0,
      "default": 20
    },
    "nesting_depth_info": {
      "description": "Nesting depth at which the nesting-depth lint reports info. Values below 1 are treated as 1.",
      "type": "integer",
      "minimum": 0,
      "default": 4
    },
    "nesting_depth_warning": {
      "description": "Nesting depth at which the nesting-depth lint reports a warning. A value below nesting_depth_info is treated as equal to it.",
      "type": "integer",
      "minimum": 0,
      "default": 6
    },
    "nesting_depth_error": {
      "description": "Nesting depth at which the nesting-depth lint reports an error. A value below nesting_depth_warning is treated as equal to it.",
      "type": "integer",
      "minimum": 0,
      "default": 9
    },
    "parameter_count_max": {
      "description": "Maximum number of parameters an author-defined function may have before the parameter-count lint reports a warning.",
      "type": "integer",
      "minimum": 0,
      "default": 5
    },
    "function_length_max_code_lines": {
      "description": "Maximum number of non-blank, non-comment body lines a function or event may have before the function-length lint reports a warning.",
      "type": "integer",
      "minimum": 0,
      "default": 10
    },
    "function_length_max_lines": {
      "description": "Maximum number of physical body lines a function or event may have before the function-length lint reports a warning.",
      "type": "integer",
      "minimum": 0,
      "default": 20
    },
    "min_wait_interval": {
      "description": "Interval/duration argument a Utility.Wait / RegisterForUpdate / RegisterForSingleUpdate / RegisterForUpdateGameTime / RegisterForSingleUpdateGameTime call can go below before short-wait-interval flags it.",
      "type": "number",
      "minimum": 0,
      "default": 0.1
    },
    "fail_on_warning": {
      "description": "Whether the CLI treats a warning-level diagnostic as a non-zero exit. Has no effect on the desktop app.",
      "type": "boolean",
      "default": false
    },
    "fail_on_info": {
      "description": "Whether the CLI treats an info-level diagnostic as a non-zero exit. Has no effect on the desktop app.",
      "type": "boolean",
      "default": false
    },
    "bool_like_int": {
      "description": "Whether strict-boolean accepts the Int literals 1 and 0 used directly as If/ElseIf/While conditions.",
      "type": "boolean",
      "default": true
    },
    "treat_form_as_bool_for_returns": {
      "description": "Whether return-types accepts a non-array Form value returned from a Bool function, relying on Papyrus's implicit None/existing Form conversion.",
      "type": "boolean",
      "default": false
    },
    "assume_auto_properties_filled": {
      "description": "Whether none-form-usage treats a script-level Auto/AutoReadOnly property as already filled in by the time a function runs, instead of possibly None.",
      "type": "boolean",
      "default": false
    },
    "utf8_bom_mode": {
      "description": "UTF-8 BOM policy when the utf8-bom rule is enabled.",
      "type": "string",
      "enum": [
        "required",
        "allowed",
        "forbidden"
      ],
      "default": "forbidden"
    },
    "encoding_enforced": {
      "description": "Required file encoding when the forced-encoding rule is enabled.",
      "type": "string",
      "enum": [
        "utf8",
        "windows-1252",
        "iso-8859-1"
      ],
      "default": "utf8"
    },
    "line_endings_mode": {
      "description": "Required line terminator when the line-endings rule is enabled. lf is \\n; crlf is \\r\\n.",
      "type": "string",
      "enum": [
        "lf",
        "crlf"
      ],
      "default": "lf"
    },
    "rules": {
      "description": "Per-rule enable/disable switches. Omitted keys use each rule's default.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "alias_cast_without_getreference": {
          "description": "Alias cast without GetReference",
          "type": "boolean",
          "default": true
        },
        "argument_naming": {
          "description": "Argument naming consistency",
          "type": "boolean",
          "default": true
        },
        "argument_override_types": {
          "description": "Argument override type check",
          "type": "boolean",
          "default": true
        },
        "argument_types": {
          "description": "Argument type check",
          "type": "boolean",
          "default": true
        },
        "array_bounds": {
          "description": "Array bounds",
          "type": "boolean",
          "default": true
        },
        "array_size_range": {
          "description": "Array size range",
          "type": "boolean",
          "default": true
        },
        "array_used_before_new": {
          "description": "Array used before New",
          "type": "boolean",
          "default": true
        },
        "assignment_operator_spacing": {
          "description": "Spacing around assignment operators",
          "type": "boolean",
          "default": true
        },
        "assignment_overwritten": {
          "description": "Assignment overwritten before read",
          "type": "boolean",
          "default": true
        },
        "auto_state_oninit_misunderstanding": {
          "description": "OnInit inside non-Auto state",
          "type": "boolean",
          "default": true
        },
        "boolean_simplification": {
          "description": "Boolean simplification",
          "type": "boolean",
          "default": true
        },
        "chain_whitespace": {
          "description": "Whitespace interrupting property/method chaining",
          "type": "boolean",
          "default": true
        },
        "circular_dependency": {
          "description": "Circular script dependency",
          "type": "boolean",
          "default": false
        },
        "comma_spacing": {
          "description": "Space after comma",
          "type": "boolean",
          "default": true
        },
        "conflicting_script_versions": {
          "description": "Conflicting script versions",
          "type": "boolean",
          "default": true
        },
        "contradictory_condition": {
          "description": "Contradictory condition",
          "type": "boolean",
          "default": true
        },
        "cyclomatic_complexity": {
          "description": "Cyclomatic complexity",
          "type": "boolean",
          "default": true
        },
        "debug_side_effects": {
          "description": "Side-effecting call inside Debug.*",
          "type": "boolean",
          "default": true
        },
        "default_property_value": {
          "description": "Default property value",
          "type": "boolean",
          "default": false
        },
        "deprecated_functions": {
          "description": "Deprecated function usage",
          "type": "boolean",
          "default": true
        },
        "division_by_zero": {
          "description": "Division by zero",
          "type": "boolean",
          "default": true
        },
        "duplicate_conditional_body": {
          "description": "Duplicate adjacent If/ElseIf/Else body",
          "type": "boolean",
          "default": true
        },
        "duplicate_import": {
          "description": "Duplicate import",
          "type": "boolean",
          "default": true
        },
        "empty_body": {
          "description": "Empty loop/conditional body",
          "type": "boolean",
          "default": true
        },
        "empty_event_handler": {
          "description": "Empty event handler",
          "type": "boolean",
          "default": true
        },
        "event_signature_mismatch": {
          "description": "Event signature mismatch",
          "type": "boolean",
          "default": false
        },
        "exclamation_spacing": {
          "description": "Exclamation mark spacing",
          "type": "boolean",
          "default": true
        },
        "explicit_return": {
          "description": "Explicit return on every path",
          "type": "boolean",
          "default": true
        },
        "final_newline": {
          "description": "Final newline",
          "type": "boolean",
          "default": true
        },
        "float_equality": {
          "description": "Float equality comparison",
          "type": "boolean",
          "default": false
        },
        "float_int_conversion": {
          "description": "Implicit Float-to-Int conversion",
          "type": "boolean",
          "default": true
        },
        "forbidden_functions": {
          "description": "Forbidden/discouraged function usage",
          "type": "boolean",
          "default": true
        },
        "forced_encoding": {
          "description": "Forced encoding",
          "type": "boolean",
          "default": true
        },
        "formid_hex_notation": {
          "description": "FormID hex notation",
          "type": "boolean",
          "default": true
        },
        "function_length": {
          "description": "Function length",
          "type": "boolean",
          "default": true
        },
        "function_override": {
          "description": "Inherited function override",
          "type": "boolean",
          "default": true
        },
        "get_form_from_file_load_index": {
          "description": "Game.GetFormFromFile load index",
          "type": "boolean",
          "default": true
        },
        "get_form_from_file_skyrim_esm": {
          "description": "Game.GetFormFromFile(\"Skyrim.esm\") simplification",
          "type": "boolean",
          "default": true
        },
        "get_state_comparison": {
          "description": "GetState() comparison",
          "type": "boolean",
          "default": true
        },
        "global_variable_increment": {
          "description": "GlobalVariable increment via SetValue(GetValue() + x)",
          "type": "boolean",
          "default": true
        },
        "global_variable_setvalue": {
          "description": "GlobalVariable no-op write",
          "type": "boolean",
          "default": false
        },
        "goto_state": {
          "description": "GoToState state reference",
          "type": "boolean",
          "default": true
        },
        "hungarian_prefix": {
          "description": "Hungarian prefix",
          "type": "boolean",
          "default": false
        },
        "identifier_casing": {
          "description": "Identifier casing",
          "type": "boolean",
          "default": true
        },
        "impossible_cast": {
          "description": "Impossible cast",
          "type": "boolean",
          "default": true
        },
        "indentation": {
          "description": "Formatting checks",
          "type": "boolean",
          "default": true
        },
        "int_division_to_float": {
          "description": "Int/Int division widened to Float",
          "type": "boolean",
          "default": true
        },
        "invalid_random_range": {
          "description": "Invalid random range",
          "type": "boolean",
          "default": true
        },
        "invariant_loop_condition": {
          "description": "Invariant loop condition",
          "type": "boolean",
          "default": true
        },
        "line_endings": {
          "description": "Line endings",
          "type": "boolean",
          "default": true
        },
        "line_length": {
          "description": "Line length",
          "type": "boolean",
          "default": true
        },
        "local_variable_shadowing": {
          "description": "Local variable shadowing",
          "type": "boolean",
          "default": true
        },
        "magic_numbers": {
          "description": "Magic numbers",
          "type": "boolean",
          "default": false
        },
        "member_access": {
          "description": "Member access control",
          "type": "boolean",
          "default": true
        },
        "member_chain_none_usage": {
          "description": "Chained member access may dereference None",
          "type": "boolean",
          "default": false
        },
        "missing_doc_comment": {
          "description": "Missing documentation comment",
          "type": "boolean",
          "default": false
        },
        "missing_override": {
          "description": "Missing override annotation",
          "type": "boolean",
          "default": false
        },
        "missing_parent_call_in_override": {
          "description": "Missing parent call in event override",
          "type": "boolean",
          "default": true
        },
        "missing_update_handler": {
          "description": "Missing update event handler",
          "type": "boolean",
          "default": false
        },
        "multiple_auto_states": {
          "description": "Multiple Auto states",
          "type": "boolean",
          "default": true
        },
        "named_arguments": {
          "description": "Prefer named arguments",
          "type": "boolean",
          "default": true
        },
        "native_function_usage": {
          "description": "Non-base-game native function usage",
          "type": "boolean",
          "default": false
        },
        "nesting_depth": {
          "description": "Nesting depth",
          "type": "boolean",
          "default": true
        },
        "non_global_function_call": {
          "description": "Non-static function call",
          "type": "boolean",
          "default": true
        },
        "none_form_usage": {
          "description": "None used as an existing Form",
          "type": "boolean",
          "default": true
        },
        "numeric_comparison": {
          "description": "Strict numeric type check",
          "type": "boolean",
          "default": true
        },
        "operator_spacing": {
          "description": "Spacing around logical/comparison operators",
          "type": "boolean",
          "default": true
        },
        "parameter_count": {
          "description": "Parameter count",
          "type": "boolean",
          "default": true
        },
        "parameter_reassignment": {
          "description": "Parameter reassignment",
          "type": "boolean",
          "default": true
        },
        "place_at_me": {
          "description": "Unsafe ObjectReference.PlaceAtMe() calls",
          "type": "boolean",
          "default": true
        },
        "property_never_assigned": {
          "description": "Property never assigned",
          "type": "boolean",
          "default": false
        },
        "property_never_read": {
          "description": "Write-only script properties",
          "type": "boolean",
          "default": true
        },
        "property_sorting": {
          "description": "Property sorting",
          "type": "boolean",
          "default": false
        },
        "quest_stage_logic_gap": {
          "description": "SetStage without stage check",
          "type": "boolean",
          "default": false
        },
        "readonly_property_write": {
          "description": "Read-only (AutoReadOnly) property write",
          "type": "boolean",
          "default": true
        },
        "redundant_bool_assignment": {
          "description": "Redundant bool assignment",
          "type": "boolean",
          "default": true
        },
        "redundant_condition": {
          "description": "Redundant condition",
          "type": "boolean",
          "default": true
        },
        "register_for_update_in_on_update": {
          "description": "Periodic RegisterForUpdate inside OnUpdate",
          "type": "boolean",
          "default": true
        },
        "repeated_getvalue": {
          "description": "Repeated GlobalVariable.GetValue() calls",
          "type": "boolean",
          "default": false
        },
        "repeated_setoutfit": {
          "description": "Repeated Actor.SetOutfit() calls",
          "type": "boolean",
          "default": true
        },
        "return_types": {
          "description": "Return type check",
          "type": "boolean",
          "default": true
        },
        "script_filename_mismatch": {
          "description": "ScriptName/filename mismatch",
          "type": "boolean",
          "default": true
        },
        "script_name_collision": {
          "description": "Property/variable named as script",
          "type": "boolean",
          "default": true
        },
        "self_assignment": {
          "description": "Self-assignment",
          "type": "boolean",
          "default": true
        },
        "self_comparison": {
          "description": "Self-comparison",
          "type": "boolean",
          "default": true
        },
        "semicolon": {
          "description": "Semicolon at end of line",
          "type": "boolean",
          "default": true
        },
        "setvalue_in_loop": {
          "description": "Repeated GlobalVariable.SetValue() calls in a loop",
          "type": "boolean",
          "default": true
        },
        "short_wait_interval": {
          "description": "Short wait/update interval",
          "type": "boolean",
          "default": true
        },
        "slow_functions": {
          "description": "Slow function usage",
          "type": "boolean",
          "default": true
        },
        "stale_compiled_output": {
          "description": "Stale compiled output",
          "type": "boolean",
          "default": true
        },
        "state_function_signature": {
          "description": "State function signature mismatch",
          "type": "boolean",
          "default": true
        },
        "state_missing_empty_fallback": {
          "description": "State function missing empty-state fallback",
          "type": "boolean",
          "default": true
        },
        "static_condition": {
          "description": "Static condition",
          "type": "boolean",
          "default": true
        },
        "static_function_call_via_instance": {
          "description": "Static function called via instance",
          "type": "boolean",
          "default": true
        },
        "strict_boolean": {
          "description": "Strict boolean check",
          "type": "boolean",
          "default": true
        },
        "too_many_states": {
          "description": "Total named state count",
          "type": "boolean",
          "default": true
        },
        "trailing_whitespace": {
          "description": "Trailing whitespace",
          "type": "boolean",
          "default": true
        },
        "type_casing": {
          "description": "Type name casing",
          "type": "boolean",
          "default": true
        },
        "unchecked_array_element": {
          "description": "Array element used without a None check",
          "type": "boolean",
          "default": false
        },
        "unchecked_cast": {
          "description": "Unchecked cast",
          "type": "boolean",
          "default": true
        },
        "unchecked_form_parameter": {
          "description": "Form parameter used without a None check",
          "type": "boolean",
          "default": false
        },
        "undefined_event": {
          "description": "Undefined event",
          "type": "boolean",
          "default": true
        },
        "unguarded_self_recursion": {
          "description": "Unguarded self-recursion",
          "type": "boolean",
          "default": true
        },
        "unknown_actor_value": {
          "description": "Unknown Actor Value",
          "type": "boolean",
          "default": false
        },
        "unknown_remote_event": {
          "description": "Unknown remote event name",
          "type": "boolean",
          "default": true
        },
        "unnecessary_function": {
          "description": "Unnecessary function",
          "type": "boolean",
          "default": true
        },
        "unreachable_elseif": {
          "description": "Unreachable elseif",
          "type": "boolean",
          "default": true
        },
        "unreachable_statement": {
          "description": "Unreachable statement",
          "type": "boolean",
          "default": true
        },
        "unregistered_remote_event": {
          "description": "Unregistered remote event handler",
          "type": "boolean",
          "default": true
        },
        "unresolved_script": {
          "description": "Unresolved script reference",
          "type": "boolean",
          "default": true
        },
        "unused_disable": {
          "description": "Unused disable directive",
          "type": "boolean",
          "default": false
        },
        "unused_function": {
          "description": "Unused private function",
          "type": "boolean",
          "default": true
        },
        "unused_getter": {
          "description": "Getter usage without saving result",
          "type": "boolean",
          "default": true
        },
        "unused_import": {
          "description": "Unused import",
          "type": "boolean",
          "default": true
        },
        "unused_local_variable": {
          "description": "Unused or write-only local variables",
          "type": "boolean",
          "default": true
        },
        "unused_nodiscard": {
          "description": "Discarded nodiscard result",
          "type": "boolean",
          "default": true
        },
        "unused_property": {
          "description": "Unused script properties",
          "type": "boolean",
          "default": true
        },
        "unused_state": {
          "description": "Unused states",
          "type": "boolean",
          "default": true
        },
        "useless_downcast": {
          "description": "Useless downcast",
          "type": "boolean",
          "default": true
        },
        "utf8_bom": {
          "description": "UTF-8 BOM",
          "type": "boolean",
          "default": true
        },
        "variable_used_before_assignment": {
          "description": "Local variable used before assignment",
          "type": "boolean",
          "default": true
        }
      }
    }
  }
}

View raw source on GitHub →