Default configuration (papyrus-lint.yaml)
The full papyrus-lint.yaml written into a project with no configuration file yet, with every key's default value documented inline. See the configuration reference for what each key does.
# Target game. Currently supported: skyrim, legacy, fallout4, starfield
game: skyrim
# Path to PapyrusCompiler.exe, or null to auto-detect it
compiler_path: null
# Extra directories (relative to the project root, or absolute) to search
# for .psc files, besides scripts/source and source/scripts
additional_script_roots: []
# 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
lookup_script_roots: []
# true, false; also runs PapyrusCompiler.exe (into a throwaway temporary
# directory) as part of linting a dropped .psc, reporting its errors
# alongside the lint engine's own. Requires compiler_path to be set/
# auto-detected
compile_check: false
# true enables strict cross-script resolution and conflicting-script-versions
# checks for only the achlist's listed entries. false (the default) keeps
# parent-directory search roots. In strict mode, every .psc dependency must
# be listed in the achlist
strict_achlist_scope: false
# true, false
semicolon: false
# tab, space
indentation: tab
# Non-negative integer; used only when indentation is space
indentation_width: 4
# Non-negative integer; maximum characters allowed on one line
max_line_length: 120
# PascalCase, camelCase, lowercase, UPPERCASE
type_casing: PascalCase
# camelCase, PascalCase, snake_case, CONSTANT_CASE
identifier_casing: PascalCase
# allow, forbid
hungarian: allow
# always, instead_of_defaults, never
named_arguments: never
# loose, strict
magic_numbers: loose
# Non-negative integer
cyclomatic_complexity_warning: 10
# Non-negative integer
cyclomatic_complexity_error: 20
# Non-negative integer
nesting_depth_info: 4
# Non-negative integer
nesting_depth_warning: 6
# Non-negative integer
nesting_depth_error: 9
# Non-negative integer
parameter_count_max: 5
# Non-negative integer
function_length_max_code_lines: 10
# Non-negative integer
function_length_max_lines: 20
# Non-negative number
min_wait_interval: 0.1
# true, false
fail_on_warning: false
# true, false
fail_on_info: false
# true, false
bool_like_int: true
# true allows a Bool function to return a non-array Form value, relying on
# Papyrus to treat None as false and an existing Form as true
treat_form_as_bool_for_returns: false
# true, false; true treats an Auto/AutoReadOnly property as already
# filled in by the time a function runs instead of possibly None
assume_auto_properties_filled: false
# required, allowed, forbidden
utf8_bom_mode: forbidden
# utf8, windows-1252, iso-8859-1
encoding_enforced: utf8
# lf (\n), crlf (\r\n)
line_endings_mode: lf
# Each rule accepts true to enable or false to disable
rules:
alias_cast_without_getreference: true # Flags casting a Quest Alias / ReferenceAlias / LocationAlias directly to Actor, ObjectReference, Location, or another non-Alias type. Aliases are not the filled form; use GetReference(), GetActorReference(), or GetLocation(). Casting an Alias to another *Alias type, or to a script that extends an alias type, is allowed.
argument_naming: true # Flag a function declared on this script whose parameter name doesn't match (case-insensitively) the corresponding parameter of the same-named function declared on the script it Extends.
argument_override_types: true # Flags a function or event whose parameter count or types don't match the same-named function declared on the script it Extends.
argument_types: true # Flags call-site arguments whose type doesn't match the callee's declared parameter type.
array_bounds: true # Flags a literal index into a local array that falls outside the constant size it was declared with (e.g. new Float[3] followed by a[5]), since Papyrus silently no-ops the access instead of raising an error.
array_size_range: true # Flags, as an error, a new array whose own literal size falls outside 0 to 128, since Papyrus hard-caps a script-created array at 128 elements and a negative size makes no sense; doesn't apply to array Properties or natively-returned arrays, so those aren't checked against it.
array_used_before_new: true # Flags indexing or member access (.Length, Find, Add, …) on a local array that is still known to be None because it was never created with New (or assigned another array).
assignment_operator_spacing: true # Requires exactly one space on either side of =, +=, -=, *=, /=, and %=.
assignment_overwritten: true # Flags a write to a local variable or function parameter that is overwritten by a later assignment with no read of that value in between.
auto_state_oninit_misunderstanding: true # Flags OnInit declared inside a non-Auto named State, where it never runs at attach time.
boolean_simplification: true # Flags a Bool compared with == or != against true or false, since the value or its negation already says the same thing. The fix rewrites it to the value or '! value'.
chain_whitespace: true # Flags a space or tab immediately before or after a member/method access.
circular_dependency: false # Flags a Property whose declared type, followed through that script's own Property declarations, eventually leads back to the script being linted (e.g. script A declaring a B Property while script B declares an A Property). A property typed as its own script isn't flagged. Disabled by default, since two scripts intentionally referencing each other for two-way communication is a common, legitimate design.
comma_spacing: true # Requires whitespace after commas in argument lists.
conflicting_script_versions: true # Flags byte-different copies of the same script in separate source directories. Identity is the path under the script root, so User/Foo.psc does not conflict with Other/Foo.psc.
contradictory_condition: true # Flags a compound && condition whose clauses on the same identifier cannot all be true.
cyclomatic_complexity: true # Flags functions/events whose cyclomatic complexity exceeds a configurable threshold. A configured error threshold below the warning one is treated as equal to it.
debug_side_effects: true # Flags a call to a side-effecting function nested inside any Debug.* argument list, since that call only runs when the debug output itself runs.
default_property_value: false # Flags a Bool/Int/Float/String Auto/AutoReadOnly property with no explicit default value, since it then silently falls back to Papyrus's own implicit per-type default instead of a value the author chose. Disabled by default.
deprecated_functions: true # Flags calls to compiled-in deprecated functions or project functions marked `; @deprecated`, and recommends supported alternatives where available.
division_by_zero: true # Flags divisions by zero where they are likely to happen.
duplicate_conditional_body: true # Flags consecutive If/ElseIf/Else branches whose bodies are the same, since that usually means a branch was copied and left unchanged.
duplicate_import: true # Flags a repeated Import of the same script (case-insensitive). Distinct from unused-import, which removes imports that are never referenced; a used import listed twice is still a duplicate. The fix drops later duplicates and keeps the first.
empty_body: true # Flags seemingly useless loops and conditional bodies, since they are likely a mistake.
empty_event_handler: true # Flags a completely empty Event in the empty/default state. Empty handlers inside a named State are left alone, since those often intentionally mute an inherited or engine event.
event_signature_mismatch: false # Flags, as a warning, an Event declaration whose name matches one of the engine's own native events but whose parameter count/types don't match the signature it's actually called with, since a mismatched declaration still compiles but the engine then never invokes it correctly. Disabled by default, since the known-event list is a curated subset and matches by name alone.
exclamation_spacing: true # Flags a negation operator not followed by exactly one space. In a chained negation such as !!bReady, only the final ! requires a trailing space.
explicit_return: true # Flags a typed function/event with a code path that falls off the end of its body without a Return.
final_newline: true # Requires non-empty files to end with exactly one newline.
float_equality: false # Flags a direct == or != between two floats, since rounding error can make them compare unequal even when conceptually the same. Disabled by default.
float_int_conversion: true # Flags a Float value declared, assigned, returned, or passed as an argument into an Int-typed slot without an explicit as Int cast.
forbidden_functions: true # Flags calls to functions that are usually unintentional performance bottlenecks. `Debug.*` already behind a simple debug-flag If (e.g. `If IsDebugMode`) is left unflagged.
forced_encoding: true # Requires a file to be representable in the configured encoding.
formid_hex_notation: true # Flags a FormID literal compared against GetFormID() or passed to Game.GetFormFromFile that isn't written in hexadecimal.
function_length: true # Flags functions/events whose body is longer than a configurable line count.
function_override: true # Informs about a function declared on this script that shares its name with a function declared on the script it extends.
get_form_from_file_load_index: true # Flags a hex FormID literal passed to Game.GetFormFromFile that carries a non-zero load index, or leading zero digits, neither of which Game.GetFormFromFile ever uses.
get_form_from_file_skyrim_esm: true # Flags Game.GetFormFromFile(id, "Skyrim.esm"), which is exactly what Game.GetForm(id) already does.
get_state_comparison: true # Flags a GetState() == "Name"/!= "Name" comparison against an undefined state, since it then always evaluates to the same result instead of raising an error.
global_variable_increment: true # Flags gv.SetValue(gv.GetValue() + x), since GlobalVariable's native Mod(x) call does the same thing in one call instead of two; the fix rewrites the call to gv.Mod(x).
global_variable_setvalue: false # Flags a SetValue/SetValueInt call that doesn't provably change the value: a branch writing back the exact value its own GetValue() == literal condition just confirmed, or an Else branch writing a literal with no check ruling out that value already being current. Disabled by default.
goto_state: true # Flags states that are undefined, likely because of typos.
hungarian_prefix: false # Flags a parameter or local/script variable that does not follow the configured Hungarian type prefix (allow requires b/i/f/s/k, with a leading a on arguments; forbid rejects those prefixes). Disabled by default.
identifier_casing: true # Flags a declared function/event, property, state, parameter, or local/script variable whose name doesn't match the configured style.
impossible_cast: true # Flags an As cast proven to never succeed, e.g. Weapon b = a as Weapon where a is an Armor, since Armor and Weapon are unrelated types. Only flagged once both types are confirmed to resolve to a known root.
indentation: true # Flags lines whose indentation doesn't match the configured style/width.
int_division_to_float: true # Flags an Int/Int division declared, assigned, returned, or passed as an argument into a Float-typed slot, since Papyrus truncates the division before it ever widens into the Float (e.g. Float f = 1 / 2 yields 0.0, not 0.5). A constant division that divides evenly (e.g. 72 / 8) isn't flagged.
invalid_random_range: true # Flags, as an error, a Utility.RandomInt/RandomFloat call whose first argument isn't smaller than its second, since that never produces any actual randomness.
invariant_loop_condition: true # Flags a While loop whose condition depends on a local variable/parameter that's never assigned anywhere in its own body, since it can then never stop or never run.
line_endings: true # Requires every line terminator in a file to be the configured lf (\n) or crlf (\r\n).
line_length: true # Flags lines that exceed the configured maximum character count.
local_variable_shadowing: true # Flags a local variable whose name matches (case-insensitively) a Property or a plain script-level variable declared on the same script.
magic_numbers: false # Flags numeric literals used directly instead of through a named constant, property, or local variable. -1, 0 and 1 are never flagged. Loose mode (default) exempts Wait/RegisterFor(Single)Update(GameTime) intervals, Strict checks them too. Disabled by default.
member_access: true # Flags access to a function or property whose @private or @protected visibility does not permit access from the current script.
member_chain_none_usage: false # Flags a member/method access whose receiver is itself a member or call (e.g. a.GetLinkTo(...).Kill()), which none-form-usage skips. Opt-in: intermediate results are not proven None, so this is noisier than none-form-usage.
missing_doc_comment: false # Flags a ScriptName, Property, or Function/Event declaration with no {...} documentation comment on the line right after it. Disabled by default.
missing_override: false # Flags a function or event that overrides an inherited member without a `; @override` annotation on the header or the line above it. Disabled by default. The fix adds `; @override` to the header.
missing_parent_call_in_override: true # Flags an Event that overrides a non-empty event on a project script it Extends without calling Parent.Event(). Empty parent events, and events on Native scripts, are not flagged. Every event name is checked.
missing_update_handler: false # Flags, as a warning, a RegisterForUpdate/RegisterForSingleUpdate/RegisterForUpdateGameTime/RegisterForSingleUpdateGameTime call with no matching OnUpdate/OnUpdateGameTime Event declared anywhere in the script, since the registration then has no effect. Disabled by default, since a matching Event declared on a script it Extends would otherwise be misreported as missing.
multiple_auto_states: true # Reports multiple Auto states in one script as an error, or multiple across its ancestry as a warning.
named_arguments: true # Flags a positional call argument that the configured setting prefers to see passed by Papyrus's named-argument syntax instead; the fix inserts the matching parameter name ahead of it.
native_function_usage: false # Flags a Native function/event whose name isn't one of the base game's own, a sign it needs SKSE/F4SE or another native extension. Disabled by default.
nesting_depth: true # Flags functions/events whose If/While nesting depth exceeds a configurable threshold.
non_global_function_call: true # Flags a ScriptName.Function() call whose target function resolves but isn't declared Global, since Papyrus's static call syntax can only reach Global functions.
none_form_usage: true # Flags a member/method access on a local variable or script-level property that's still known to be None. Set assume_auto_properties_filled to stop assuming an unset Auto/AutoReadOnly property starts out None; it's still tracked once code assigns it None directly.
numeric_comparison: true # Flags implicit comparisons between ints and floats that rely on Papyrus doing type conversions.
operator_spacing: true # Requires exactly one space on either side of logical operators.
parameter_count: true # Flags author-defined functions whose parameter list is longer than a configurable maximum.
parameter_reassignment: true # Flags a function/event parameter assigned a new value anywhere in its own body.
place_at_me: true # Flags PlaceAtMe/PlaceActorAtMe calls whose returned reference is not stored, and PlaceAtMe calls that create multiple objects at once, because either pattern prevents reliable cleanup of every created object.
property_never_assigned: false # Flags a non-Auto property whose backing field and property name are never written outside the Get/Set block, so readers stay on the implicit default. Disabled by default because Creation Kit–filled properties are common; suppress a single property with ; @external.
property_never_read: true # Flags Property declarations that are assigned in this script but whose value is never read.
property_sorting: false # Flag declaration that isn't sorted by type and then alphabetically by name, or that isn't declared immediately after the ScriptName line, before any variable, function, or state declaration.
quest_stage_logic_gap: false # Opt-in: flags a SetStage call on the script's own quest with no earlier GetStageDone/GetStage check in the same function. Only relevant for quests with "Allow Repeated Stages" enabled. Fragment scripts are skipped.
readonly_property_write: true # Flags an assignment to a property declared AutoReadOnly, since Papyrus rejects that at compile time. Matches the property's bare name or Self.PropertyName; a bare name shadowed by a same-named local/parameter is left alone.
redundant_bool_assignment: true # Flags an If/Else that only assigns true in one branch and false in the other to the same target, since a direct boolean expression says the same thing. The fix rewrites it to a single assignment.
redundant_condition: true # Flags a compound condition clause that is dominated or duplicated by another clause on the same identifier.
register_for_update_in_on_update: true # Flags RegisterForUpdate / RegisterForUpdateGameTime called inside OnUpdate / OnUpdateGameTime, which stacks another repeating timer every tick; use RegisterForSingleUpdate (or the GameTime variant) instead.
repeated_getvalue: false # Flags GetValue() called on the same global more than once across an If/ElseIf chain's conditions, since it can be cached in a local variable instead. Disabled by default.
repeated_setoutfit: true # Flags a second SetOutfit(...) call passing the exact same outfit (and other arguments) as an earlier call on the same receiver, with nothing in between guaranteed to have changed what they're wearing, since a redundant repeated SetOutfit call is known to sometimes leave the actor with no visible equipment. Matches by the SetOutfit method name alone, case-insensitively, without resolving the receiver to an Actor.
return_types: true # Flags statements whose value's type doesn't match the enclosing function's declared return type.
script_filename_mismatch: true # Flags a .psc file whose declared ScriptName doesn't match its path under the script root, aside from casing. An unqualified name is the file stem; Fallout 4 / Starfield A:B:C must end in A/B/C.psc after any layout folders the name does not include.
script_name_collision: true # Flags a script-level Property or variable whose name matches the script it's declared in, since Papyrus fails to compile it.
self_assignment: true # Flags a plain = assignment whose right side is the exact same reference as its own target (e.g. a = a, Self.Foo = Self.Foo), since it can never change the value and is almost always a mistake. Only a bare name or a chain of member accesses is compared this way; calls, indexes, and compound assignments (+=, ...) are never flagged.
self_comparison: true # Flags comparing a reference to itself (e.g. count == count, actor != actor), which is always true or always false and almost always a typo. Only bare names / member chains; calls and indexes are never treated as identical.
semicolon: true # Requires a trailing semicolon on each non-empty line or forbids terminal semicolons, according to the selected setting.
setvalue_in_loop: true # Flags a SetValue/SetValueInt call inside a While loop's body, since it then runs on every iteration; not flagged if the loop also calls Utility.Wait/RegisterForUpdate.
short_wait_interval: true # Flags Waits and RegisterFor(Single)Update(GameTime) if the time is smaller than a configured amount.
slow_functions: true # Flags calls to functions that have a faster equivalent available; the fix applies the supplied replacement.
stale_compiled_output: true # Flags a .psc file whose compiled .pex is older than the script itself, usually meaning it was edited and never recompiled.
state_function_signature: true # Flags a function or event in a State whose parameters or return type don't match its empty-state declaration.
state_missing_empty_fallback: true # Flags a function or event declared only inside a named State, with no empty-state fallback.
static_condition: true # Flags conditions that resolve the same every time due to this likely being a mistake.
static_function_call_via_instance: true # Flags a Global function called through an object reference (e.g. akRef.MyGlobalHelper()) instead of ScriptName.MyGlobalHelper(); Papyrus allows it, but it can read as a mistake. Self/Parent are never flagged.
strict_boolean: true # Flags conditions that rely on Papyrus treating a none-boolean as a boolean. Allows the literal 1/0 as bool-like by default (configurable).
too_many_states: true # Flags a file if the number of states exceeds the possible 128.
trailing_whitespace: true # Flags lines that end with trailing spaces or tabs.
type_casing: true # Flags a script's declared type name if it doesn't follow the configured convention. Ignores a leading acronym prefix (e.g. CreationKit's own fragment names or a mod's acronym prefix), which can't be renamed.
unchecked_array_element: false # Flags a member/method access on a constant-indexed array element (e.g. act[2].Kill()) that hasn't yet been confirmed non-None in that path. Disabled by default, same as the Form parameter check above.
unchecked_cast: true # Flags a member/method access on the result of an As cast before that result has been checked against None. Never flags CreationKit's own fragment boilerplate cast (e.g. Actor akSpeaker = akSpeakerRef as Actor).
unchecked_form_parameter: false # Flags a member/method access on a Form-typed function parameter that hasn't yet been confirmed non-None in that path.
undefined_event: true # Warns about event handlers whose names are not defined anywhere in the script's ancestry, excluding engine-handled scripts and remote events.
unguarded_self_recursion: true # Flags a function/event that calls itself with nothing that could ever skip the recursive call, since it then recurses unconditionally until the call stack is exhausted. Conservative: a self-call nested inside an If or a non-constant While is always left alone, a top-level While whose condition does not fold to true always disqualifies the function, and a While whose condition folds to true is treated as an infinite loop whose body is examined. A top-level If only counts as a guard when it actually contains a reachable Return — an If with no Return, or a Return only inside an always-false branch, does nothing to stop the call and is still flagged. A GoToState to a different state that declares its own handler for the same function/event, before the self-call, counts as a guard too, covering the vanilla save-compatibility idiom. Exception: if every branch of an If/Elseif/Else covering every path directly calls itself, it's flagged anyway, since it recurses no matter which branch runs.
unknown_actor_value: false # Flags a call to an Actor Value function (GetActorValue, SetActorValue, ModActorValue, DamageActorValue, ...) whose Actor Value name isn't one of the target game's built-in ones, a strong sign of a typo. Only a plain string literal argument is checked. Disabled by default, since a project's own plugin can define custom Actor Values.
unknown_remote_event: true # Flags a RegisterForRemoteEvent or UnregisterForRemoteEvent call whose event-name string is not an event on the source object's type (including ancestors). Fallout 4 / Starfield only.
unnecessary_function: true # Flags a Function whose body is empty or just a single statement. An empty body does nothing, and a single statement is usually simple enough to inline at its call site instead. Events are never flagged, since they may deliberately forward to shared logic. A Native function is never flagged either, since it has no Papyrus body — the engine supplies the implementation. A Function named Fragment_<digits> (matched case-insensitively; a CreationKit-generated fragment entry point) is never flagged either, since the engine calls it directly and it isn't something the script's own author could inline away. A parameterless Function returning Int, Float, Bool, or String whose body is exactly one statement is never flagged either, since that shape is how a script exposes a named constant to the outside world without baking it into every instance as a Property/Variable; an empty body of that shape is still flagged, because it doesn't return a constant. The fix only handles a pure forwarding wrapper (its one statement is itself a call passing every one of its own parameters straight through, unchanged, to it), rewriting call sites to call the wrapped function directly; the wrapper's own declaration is left in place. An empty function is reported but not rewritten.
unreachable_elseif: true # Flags an ElseIf whose condition can never be true because an earlier branch already covers it.
unreachable_statement: true # Flags statements that follow a Return.
unregistered_remote_event: true # Flags a remote Event Type.OnFoo(...) handler that neither this script nor any parent it Extends ever RegisterForRemoteEvent's, so the engine will not call it. Fallout 4 / Starfield only.
unresolved_script: true # Flags script name references that can't be resolved against the configured source directories.
unused_disable: false # Flags unknown @disable/@disable-file rule ids and directives that suppress no diagnostic. Disabled by default.
unused_function: true # Flags a private/internal Function that nothing in the same script calls.
unused_getter: true # Flags standalone calls to functions whose names begin with Get if the returned value is unused.
unused_import: true # Flags an Import statement whose script never has one of its Global functions called unqualified anywhere in this script. Only checked (and fixed) with project context.
unused_local_variable: true # Flags a local variable inside a function/event whose value is never read: either it's never referenced again at all or only written to.
unused_nodiscard: true # Flags discarded results of functions marked ; @nodiscard.
unused_property: true # Flags Property declarations whose name is never referenced anywhere else in the script.
unused_state: true # Flags named states that are neither Auto nor targeted by a GoToState call.
useless_downcast: true # Flags a cast to a parent type that has no actual value and just makes reading a bit harder.
utf8_bom: true # Requires, allows, or forbids a leading UTF-8 BOM.
variable_used_before_assignment: true # Flags a local variable declared without an initial value that's read before it's ever assigned one, since it then still holds its default value. A comparison against that same default (None, 0, 0.0, False, or "") is treated as a deliberate gate, not a flagged read, even when joined by && or || to a further operand that only runs once the gate rules out the default.