-
-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maplint tool now has proper github action error messages (#72920)
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.
- Loading branch information
1 parent
9412b8f
commit ee7ba9e
Showing
7 changed files
with
102 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
"""Linting error with associated filename and line number.""" | ||
class MaplintError(Exception): | ||
"""The DMM file name the exception occurred in""" | ||
file_name = "unknown" | ||
|
||
"""The line the error occurred on""" | ||
line_number = 1 | ||
|
||
"""The optional coordinates""" | ||
coordinates: str = None | ||
|
||
"""The optional pop ID""" | ||
pop_id: str = None | ||
|
||
def __init__(self, message: str, file_name: str, line_number = 1): | ||
Exception.__init__(self, message) | ||
|
||
self.file_name = file_name | ||
self.line_number = line_number | ||
|
||
"""A parsing error that must be upgrading to a linting error by parse().""" | ||
class MapParseError(Exception): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
pygit2==1.7.2 | ||
bidict==0.22.0 | ||
Pillow==9.5.0 | ||
Pillow==10.0.1 | ||
|
||
# check_regex.py | ||
colorama==0.4.4 | ||
|