Page MenuHomeWildfire Games

Adds a skip for invalid files in the validator
ClosedPublic

Authored by vladislavbelov on Dec 10 2017, 3:08 PM.

Details

Summary

There was an error noticed by @Imarok:

Traceback (most recent call last):
  File "source/tools/xmlvalidator/validator.py", line 136, in <module>
    validator.run()
  File "source/tools/xmlvalidator/validator.py", line 102, in run
    self.find_actors(os.path.join('art', 'actors'))
  File "source/tools/xmlvalidator/validator.py", line 93, in find_actors
    actor.read(self.get_physical_path(actor_file['mod_name'], actor_file['vfs_path']))
  File "source/tools/xmlvalidator/validator.py", line 19, in read
    tree = xml.etree.ElementTree.parse(physical_path)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1184, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 596, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: mismatched tag: line 37, column 2

When an actor/material file is invalid. This diff adds a check for this case.

Test Plan
  1. Make an invalid actor/material file
  2. Run the validator
  3. Ensure, that the validator isn't crashed and reported about the invalid file

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vladislavbelov created this revision.Dec 10 2017, 3:08 PM
Vulcan added a subscriber: Vulcan.Dec 10 2017, 7:13 PM
Executing section Default...
Executing section Source...
Executing section JS...

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Itms accepted this revision.Dec 12 2017, 8:41 PM

Looks very good to me, and it works (tested on rP20631). Thank you!

This revision is now accepted and ready to land.Dec 12 2017, 8:41 PM
This revision was automatically updated to reflect the committed changes.