0ad/source/tools/entity
Dunedan f43f4ae1b1
Update the pre-commit hooks
With v3.12.0 shfmt changed the behavior of the `--simplify` option to
ignore any EditorConfig when it's provided. Therefore, this option is
now moved to the EditorConfig as suggested by the shfmt author. See
https://github.com/mvdan/sh/issues/1173 for details.
2025-08-22 13:04:38 +02:00
..
scriptlib Improve find_files implementation 2025-05-27 07:32:51 +02:00
checkrefs.py Update the pre-commit hooks 2025-08-22 13:04:38 +02:00
entvalidate.py Improve find_files implementation 2025-05-27 07:32:51 +02:00
readme.md Add a markdownlint pre-commit hook 2024-08-27 10:06:31 +02:00
requirements.txt Improve performance and output of entvalidate.py 2025-03-18 12:57:01 +01:00
validate_dae.py Refactor validate_dae.py for more speed 2025-05-27 08:05:13 +02:00
validate_grammar.py Move xmlvalidator code to entity directory 2025-03-03 17:45:08 +01:00
validator.py Move xmlvalidator code to entity directory 2025-03-03 17:45:08 +01:00

Checkrefs.py

Description

This script checks the game files for missing dependencies, unused files, and for file integrity. If mods are specified, all their dependencies are also checked recursively. This script is particularly useful to detect broken actors or templates.

Requirements

  • Python 3.6+ interpreter installed
  • lxml for the -a option.

Usage

  • cd in source/tools/entity and run the script.
usage: checkrefs.py [-h] [-u] [-x] [-a] [-t] [-m MOD [MOD ...]]

Checks the game files for missing dependencies, unused files, and for file integrity.

options:
  -h, --help            show this help message and exit
  -u, --check-unused    check for all the unused files in the given mods and their dependencies.
                        Implies --check-map-xml. Currently yields a lot of false positives.
  -x, --check-map-xml   check maps for missing actor and templates.
  -a, --validate-actors
                        run the validator.py script to check if the actors files have extra or
                        missing textures.
  -t, --validate-templates
                        run the validator.py script to check if the xml files match their (.rng)
                        grammar file.
  -m MOD [MOD ...], --mods MOD [MOD ...]
                        specify which mods to check. Default to public.