From 868f562e1b9a4fde22370cdf11afe2de5b0cf561 Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Mon, 21 Aug 2023 20:23:17 -0600 Subject: [PATCH] Tools: Rename scrimmage template to have .j2 extension * This fixes an error in pre-commit's check-xml hook * Tools/autotest/template/scrimmage.xml: Failed to xml parse (Tools/autotest/template/scrimmage.xml:8:7: not well-formed (invalid token)) * Since it's a template file, it is not parseable as XML till after it's rendered by jinja Signed-off-by: Ryan Friedman --- Tools/autotest/sim_vehicle.py | 2 +- Tools/autotest/template/{scrimmage.xml => scrimmage.xml.j2} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Tools/autotest/template/{scrimmage.xml => scrimmage.xml.j2} (100%) diff --git a/Tools/autotest/sim_vehicle.py b/Tools/autotest/sim_vehicle.py index 36ca3b4685..3e0fb79eb4 100755 --- a/Tools/autotest/sim_vehicle.py +++ b/Tools/autotest/sim_vehicle.py @@ -1617,7 +1617,7 @@ if cmd_opts.frame in ['scrimmage-plane', 'scrimmage-copter']: entities[i][k] = v config['entities'] = list(entities.values()) env = Environment(loader=FileSystemLoader(os.path.join(autotest_dir, 'template'))) - mission = env.get_template('scrimmage.xml').render(**config) + mission = env.get_template('scrimmage.xml.j2').render(**config) tmp = mkstemp() atexit.register(os.remove, tmp[1]) diff --git a/Tools/autotest/template/scrimmage.xml b/Tools/autotest/template/scrimmage.xml.j2 similarity index 100% rename from Tools/autotest/template/scrimmage.xml rename to Tools/autotest/template/scrimmage.xml.j2