From 737170c1b4588194b6115cfec0ed09b3372f5c41 Mon Sep 17 00:00:00 2001 From: Mark Suckerberg Date: Sun, 7 Jan 2024 14:49:51 -0600 Subject: [PATCH] makes these lints better --- tools/maplint/lints/multiple_cables.yml | 2 +- tools/maplint/source/lint.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/maplint/lints/multiple_cables.yml b/tools/maplint/lints/multiple_cables.yml index 314efdf2e2c0..a80fe09693af 100644 --- a/tools/maplint/lints/multiple_cables.yml +++ b/tools/maplint/lints/multiple_cables.yml @@ -1,4 +1,4 @@ /obj/structure/cable: banned_neighbors: /obj/structure/cable: - matching_vars: [dir] + matching_vars: [icon_state] diff --git a/tools/maplint/source/lint.py b/tools/maplint/source/lint.py index c2ab76494312..061ccd28cdbf 100644 --- a/tools/maplint/source/lint.py +++ b/tools/maplint/source/lint.py @@ -61,7 +61,7 @@ def __init__(self, typepath, data = {}): expect(isinstance(self.identical, bool), "identical must be a boolean.") if "matching_vars" in data: - self.same_dir = data.pop("matching_vars") + self.matching_vars = data.pop("matching_vars") expect(isinstance(self.matching_vars, list), "matching_vars must be a list of variables.") if "pattern" in data: @@ -71,11 +71,11 @@ def __init__(self, typepath, data = {}): def matches(self, identified: Content, neighbor: Content): if len(self.matching_vars) > 0: - if not self.typepath.matches_path(neighbor.path): + if self.typepath is not None and not self.typepath.matches_path(neighbor.path): return False for variable in self.matching_vars: - if identified.var_edits[variable] != neighbor.var_edits[variable]: + if identified.var_edits.get(variable) != neighbor.var_edits.get(variable): return False return True