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§

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

Enums§

Confidence
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.
FileKind
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.
Game
Enum specifying which game we are validating.
Item
“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.
Severity
Determines the output colour. User can also filter by minimum severity level: e.g. don’t show me Info-level messages.

Functions§

add_loaded_mod_root
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_ansi_colors
Disable color in the output.
emit_reports
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.
log
Store an error report to be emitted when emit_reports is called.
set_output_file
Configure the error reports to be written to this file instead of to stdout.
set_output_style
Override the default OutputStyle. (Controls ansi colors)
set_show_loaded_mods
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.
set_show_vanilla
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.
suppress_from_json
take_reports
Extract the stored reports, sort them, and return them as a vector of LogReport. The stored reports will be left empty.
validate_config_file
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.