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.

Modules§

  • block πŸ”’
    Block is the core type to represent Pdx script code
  • ck3 πŸ”’
    Files specifically for validating Crusader Kings 3 mods.
  • config_load πŸ”’
    Loading and interpreting the config file.
  • context πŸ”’
    ScopeContext tracks our knowledge of the scope types used in script and validates its consistency.
  • data πŸ”’
    Validators for game item types which are generic across all supported games. Each sub-mod handles a specific item type or group of related item types.
  • datatype πŸ”’
    Validator for the [ ... ] code blocks in localization and gui files. The main entry points are the validate_datatypes function and the Datatype enum.
  • date πŸ”’
    The Date type represents in-game dates.
  • db πŸ”’
    A general database of item types. Most game items go here.
  • dds πŸ”’
    Validator for the .dds (picture) files that are used in the game.
  • desc πŸ”’
    Validator for triggered description blocks that compose a description from multiple localization keys.
  • effect πŸ”’
    Validate effects, which are parts of the script that change the game state.
  • Validators for effects that are generic across multiple games.
  • everything πŸ”’
    Stores everything known about the game and mod being validated.
  • fileset πŸ”’
    Track all the files (vanilla and mods) that are relevant to the current validation.
  • game πŸ”’
    Dealing with which game we are validating
  • gui πŸ”’
    Types and functions related to .gui file processing
  • helpers πŸ”’
    Miscellaneous convenience functions.
  • imperator πŸ”’
    Files specifically for validating Imperator: Rome mods.
  • item πŸ”’
    Giant enum for all the Item types in the game.
  • lowercase πŸ”’
    Type-safety wrapper for strings that must be lowercase
  • macros πŸ”’
    MacroCache to cache macro expansions, and MacroMap to track Loc use across macro expansions.
  • mod_metadata πŸ”’
    Loader and validator for the .metadata/metadata.json files used by Vic3
  • modfile πŸ”’
    Loader and validator for the .mod files themselves.
  • modif πŸ”’
    Validator for modifs which is our name for the basic things that modifiers modify.
  • on_action πŸ”’
    Track scope context for the builtin on-actions in the various games.
  • parse πŸ”’
    Parsers for the various kinds of game script.
  • pathtable πŸ”’
    A global table for the pathnames used in FileEntry and Loc.
  • pdxfile πŸ”’
    Helper functions for loading pdx script files in various character encodings.
  • report πŸ”’
    Error report collection and printing facilities.
  • rivers πŸ”’
    Special validator for the rivers.png file.
  • scopes πŸ”’
    The core Scopes type which tracks our knowledge about the types of in-game values.
  • script_value πŸ”’
    Validation of script values, which are values that update dynamically based on rules given in their math blocks.
  • token πŸ”’
    Contains the core Token and Loc types, which represent pieces of game script and where in the game files they came from.
  • tooltipped πŸ”’
    A helper type used for effects and triggers, which tracks what kind of tooltipping to expect. This affects which errors are logged about them. Some things only matter if an item is being tooltipped.
  • trigger πŸ”’
    Validate triggers, which are parts of the script that specify yes or no conditions.
  • util πŸ”’
    Miscellaneous helper functions related to filesystem operations.
  • validate πŸ”’
    Validation functions that are useful for more than one data module.
  • validator πŸ”’
  • vic3 πŸ”’
    Files specifically for validating Victoria 3 mods.

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.
  • Representation of a metadata.json 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.