Integrating mapmerge2 checks into Travis (#5616)

Okay, this update is kinda big. Summary:

- Trimmed unused keys in Exodus telecomms

- Adds script that will run mapmerge2 on Travis to check branch for unused keys or key overflow, etc.

- Fixes matching indentation style in tag-matcher and converts it to use Python 3.6

- Converts mapmerge2 to be used by Python 3.4 and above. Instead of 3.6

- Removes Windows 1252 characters from Communication-blackout.dm that were not able to be seen in UTF-8 format.

Note: the last commit will fail because currently main level is broken

Example of no map issues:
![2018-11-15_li](https://user-images.githubusercontent.com/25555314/48592180-0fd7be80-e8fc-11e8-80b9-cd5af32540e3.jpg)

Example of issues:
![2018-11-15_li 2](https://user-images.githubusercontent.com/25555314/48592190-15cd9f80-e8fc-11e8-99bd-6da4b4c2b9d8.jpg)
This commit is contained in:
Mykhailo Bykhovtsev
2018-11-20 11:14:21 -08:00
committed by Werner
parent d230a60a20
commit 779f8a0733
9 changed files with 162 additions and 284 deletions

View File

@@ -7,14 +7,14 @@ from collections import defaultdict
def merge_map(new_map, old_map, delete_unused=False):
if new_map.key_length != old_map.key_length:
print("Warning: Key lengths differ, taking new map")
print(f" Old: {old_map.key_length}")
print(f" New: {new_map.key_length}")
print(" Old: {}".format(old_map.key_length))
print(" New: {}".format(new_map.key_length))
return new_map
if new_map.size != old_map.size:
print("Warning: Map dimensions differ, taking new map")
print(f" Old: {old_map.size}")
print(f" New: {new_map.size}")
print(" Old: {}".format(old_map.size))
print(" New: {}".format(new_map.size))
return new_map
key_length, size = old_map.key_length, old_map.size
@@ -66,7 +66,7 @@ def merge_map(new_map, old_map, delete_unused=False):
# step two: delete unused keys
if unused_keys:
print(f"Notice: Trimming {len(unused_keys)} unused dictionary keys.")
print("Notice: Trimming {} unused dictionary keys.".format(len(unused_keys)))
for key in unused_keys:
del merged.dictionary[key]
@@ -75,10 +75,10 @@ def merge_map(new_map, old_map, delete_unused=False):
new_tile = new_map.dictionary[new_map.grid[x, y, z]]
merged_tile = merged.dictionary[merged.grid[x, y, z]]
if new_tile != merged_tile:
print(f"Error: the map has been mangled! This is a mapmerge bug!")
print(f"At {x},{y},{z}.")
print(f"Should be {new_tile}")
print(f"Instead is {merged_tile}")
print("Error: the map has been mangled! This is a mapmerge bug!")
print("At {},{},{}.".format(x, y, z))
print("Should be {}".format(new_tile))
print("Instead is {}".format(merged_tile))
raise RuntimeError()
return merged