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. - Pointed
Message - 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.
- File
Kind - 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.