0ad/source/tools/entity
Stan 88b426dc59 Fix the issues with entvalidate.py
It doesn't properly handle mixins / special templates
    On python 3.8+, XML elements are no longer sorted and this fails
validation against entity.rng
    mixins are not properly applied because the | split is incorrect (3
max items instead of 2)
    merge="" is not supported
    Parents aren't always passed when they should be.
    on windows it is incorrectly assumed that the encoding is 1252

Patch by: @baco
Tweaks by: @Stan
Based on a patch by: @wraitii
Differential Revision: https://code.wildfiregames.com/D4698
This was SVN commit r27161.
2022-10-22 16:24:45 +00:00
..
scriptlib Fix the issues with entvalidate.py 2022-10-22 16:24:45 +00:00
checkrefs.py Add a function to handle custom phase techs, so they do not show as unused. 2022-08-06 15:06:03 +00:00
creationgraph.pl Improve and fix checkrefs.pl, add a readme for usage, add mod support, add command line arguments. 2019-02-24 21:19:20 +00:00
creationgraph.py Replace checkrefs.pl by a python script. This makes it easier to run on Windows for non technical persons. 2022-02-12 15:43:42 +00:00
entvalidate.pl Improve and fix checkrefs.pl, add a readme for usage, add mod support, add command line arguments. 2019-02-24 21:19:20 +00:00
entvalidate.py Fix the issues with entvalidate.py 2022-10-22 16:24:45 +00:00
readme.md Replace checkrefs.pl by a python script. This makes it easier to run on Windows for non technical persons. 2022-02-12 15:43:42 +00: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.