Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace nearly every map grep with a YML file that actually respects structure, and fixes the massive amount of failures that were never caught #2427

Merged

Conversation

MarkSuckerberg
Copy link
Member

@MarkSuckerberg MarkSuckerberg commented Oct 25, 2023

Port of tgstation/tgstation#72372

From original PR:

Documentation here

We should not be using greps to the capacity that we currently are. If you are not smarter than a parser, then you should not try to beat one. DMM files should NOT be treated as text files that can be parsed with any old Unix tool. They are a structured language. Because of our abuse of greps, check_greps is full of hard to read, hard to maintain checks that do not consistently work, because they all make very specific assumptions about how TGM works, which are provably untrue.

This format is mostly straightforward for the lints people write, and easily extensible to the ones people will want to write.

🆑
fix: Fixes a bunch of cases of windows not being where they were supposed to be, tables/chairs stacking on each other, and other very small stuff you've never noticed before.
/:cl:

@github-actions github-actions bot added Map Change Tile placing is hard. Thank you for your service. GitHub Our very own Babylon. Code change Watch something violently break. labels Oct 25, 2023
Mothblocks and others added 4 commits October 25, 2023 19:02
…structure, and fixes the massive amount of failures that were never caught (#72372)

[Documentation
here](https://github.com/Mothblocks/tgstation/blob/maplint/tools/maplint/README.md)

We should not be using greps to the capacity that we currently are. If
you are not smarter than a parser, then you should not try to beat one.
DMM files should NOT be treated as text files that can be parsed with
any old Unix tool. They are a structured language. Because of our abuse
of greps, check_greps is full of hard to read, hard to maintain checks
that do not consistently work, because they all make very specific
assumptions about how TGM works, which are provably untrue.

This format is mostly straightforward for the lints people write, and
easily extensible to the ones people will want to write.

:cl:
fix: Fixes a bunch of cases of windows not being where they were
supposed to be, tables/chairs stacking on each other, and other very
small stuff you've never noticed before.
/:cl:
The tool added in #72372 is pretty awesome. The output is uhh cryptic
though. I had to read the source code to realize the (line 382) or
whatever part of the message was the dmm line number and there's stack
traces everywhere. I've made it support github action error messages so
now you get this beauty if you mess up:

![Example cable
error](https://user-images.githubusercontent.com/1185434/214156870-d73ffba0-f79a-43ed-9574-e74cc2ee2057.png)

Or, in the run summary:

![image](https://user-images.githubusercontent.com/1185434/214157201-e392a6d6-a8a8-4d8a-ac74-c65ae97438c8.png)

Errors parsing the lint yml's will also output github action errors,
although the line number will always be 1 since the yaml parser discards
line numbers to my knowledge.

In the midst of doing this, I made the error type contain the file and
line info, and added a bunch of type hints in the midst of trying to
understand Mothblock's code.

Note that for power users, the default behavior is still colored
terminal text; `--github` is added by the CI suite to enable this
behavior.

Much easier to see where the errors are and what they are (who even
knows what a 'pop' is? The tg game code calls them grid models.)

Nothing player-facing.
@github-actions github-actions bot added the Merge Conflict Use Git Hooks, you're welcome. label Nov 4, 2023
Copy link
Contributor

github-actions bot commented Nov 4, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the Merge Conflict Use Git Hooks, you're welcome. label Jan 7, 2024
timothymtorres and others added 15 commits January 7, 2024 10:01
…ile (#79394)

This has happened quite a few times in the past and it'd be a good idea
to have a linter catch this common mistake. After digging through the
Python code for the mapping linter, it appears the linter wasn't
correctly identifying two duplicate objects. I tweaked the code to fix
this.
@MarkSuckerberg MarkSuckerberg marked this pull request as ready for review January 8, 2024 16:11
@MarkSuckerberg MarkSuckerberg requested review from a team as code owners January 8, 2024 16:11
@MarkSuckerberg MarkSuckerberg added this pull request to the merge queue Jan 9, 2024
Merged via the queue into shiptest-ss13:master with commit e06821f Jan 9, 2024
16 checks passed
@MarkSuckerberg MarkSuckerberg deleted the updates-deps-again branch January 9, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code change Watch something violently break. GitHub Our very own Babylon. Map Change Tile placing is hard. Thank you for your service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants