Skip to content

Commit

Permalink
exclude ntss shadow from window spawner checks
Browse files Browse the repository at this point in the history
  • Loading branch information
warriorstar-orion committed Mar 23, 2024
1 parent d1dfbaa commit 5ae559b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/maplint/lints/grille_window_stacking.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
help: "Replace the grille and window with the proper spawner."
exclude_files:
# atmos can tick before the windows from the spawner spawn, leading to gas leakage
# on this shuttle
- _maps/map_files/shuttles/emergency_shadow.dmm
/obj/structure/grille:
banned_neighbors:
- /obj/structure/window/full
3 changes: 3 additions & 0 deletions tools/maplint/source/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ def process_dmm(map_filename, lints: dict[str, lint.Lint]) -> list[MaplintError]
# No structured data to lint.
return problems

map_path = pathlib.Path(map_filename)
for lint_name, lint in lints.items():
try:
if map_path in lint.exclude_files:
continue
problems.extend(lint.run(map_data))
except KeyboardInterrupt:
raise
Expand Down
5 changes: 5 additions & 0 deletions tools/maplint/source/lint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
import pathlib
from typing import Optional

from .common import Constant, Typepath
Expand Down Expand Up @@ -213,13 +214,17 @@ def run(self, identified: Content, contents: list[Content], identified_index) ->
class Lint:
help: Optional[str] = None
rules: dict[TypepathExtra, Rules]
exclude_files: list[str] = list()

def __init__(self, data):
expect(isinstance(data, dict), "Lint must be a dictionary.")

if "help" in data:
self.help = data.pop("help")

if "exclude_files" in data:
self.exclude_files = [pathlib.Path(x) for x in data.pop("exclude_files")]

expect(isinstance(self.help, str) or self.help is None, "Lint help must be a string.")

self.rules = {}
Expand Down

0 comments on commit 5ae559b

Please sign in to comment.