Crate tiger_lib

source ·
Expand description

This library forms the bulk of the -tiger family of validators: ck3-tiger, vic3-tiger, and imperator-tiger. Each executable is a small wrapper around the functions in this library that start and perform validation.

Structs§

  • A record of everything known about the game and mod being validated.
  • Describes a report about a potentially problematic situation that can be logged.
  • Representation of a .mod file and its contents.
  • A Token consists of a string and its location in the parsed files.

Enums§

  • Mostly invisible in the output. User can filter by minimum confidence level. This would be a dial for how many false positives they’re willing to put up with.
  • Note that ordering of these enum values matters. Files later in the order will override files of the same name before them, and the warnings about duplicates take that into account.
  • Enum specifying which game we are validating.
  • “items” are all the things that can be looked up in the game databases. Anything that can be looked up in script with a literal string key, or that’s loaded into tiger’s database and needs a unique key, is an Item.
  • Determines the output colour. User can also filter by minimum severity level: e.g. don’t show me Info-level messages.

Functions§

  • Record a secondary mod to be loaded before the one being validated. label is what it should be called in the error reports; ideally only a few characters long.
  • Disable color in the output.
  • Print all the stored reports to the error output. Set json if they should be printed as a JSON array. Otherwise they are printed in the default output format.
  • Store an error report to be emitted when emit_reports is called.
  • Configure the error reports to be written to this file instead of to stdout.
  • Override the default OutputStyle. (Controls ansi colors)
  • Configure the error reporter to show errors that are in extra loaded mods. Normally those are filtered out, to only show errors that involve the mod’s code.
  • Configure the error reporter to show errors that are in the base game code. Normally those are filtered out, to only show errors that involve the mod’s code.
  • Extract the stored reports, sort them, and return them as a vector of LogReport. The stored reports will be left empty.
  • Check if config file that was passed in with –conf argument is valid. If it is not valid let the user know, set it to None, and use the default one instead.