Class: Esp::Mw::Linter

Inherits:
Object
  • Object
show all
Defined in:
lib/esp/mw/linter.rb

Overview

Checks a mod’s records for dangling references and missing-master coverage. Uses Esp::Mw::ReferenceIndex for vanilla lookups and the mod’s own records for self-references.

Severity model:

  • :error — the ref points at nothing the mod or any indexed ESM defines.

  • :warning — the ref resolves in a vanilla ESM that isn’t listed in

    the mod's TES3 Header.masters. OpenMW will load the mod
    but log warnings; the mod author probably forgot to add
    the dependency.
    

Defined Under Namespace

Classes: Issue

Constant Summary collapse

SCRIPTED_TYPES =

Record types that carry a ‘script` field pointing at a Script record.

%w[
  Activator Alchemy Apparatus Armor Book Clothing Container Creature
  Door Ingredient Light Lockpick MiscItem Probe RepairItem Weapon
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(records, index) ⇒ Linter

Returns a new instance of Linter.



22
23
24
25
26
27
# File 'lib/esp/mw/linter.rb', line 22

def initialize(records, index)
  @records = records
  @index = index
  @mod_ids = build_mod_index
  @masters = extract_masters_set
end

Instance Method Details

#issuesObject



29
30
31
# File 'lib/esp/mw/linter.rb', line 29

def issues
  @issues ||= collect_issues
end