mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 12:13:06 +00:00
Maplinters Port & DMI Test Enable (#9105)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
41
tools/maplint/source/error.py
Normal file
41
tools/maplint/source/error.py
Normal file
@@ -0,0 +1,41 @@
|
||||
from typing import Optional
|
||||
|
||||
class MaplintError(Exception):
|
||||
"""Linting error with associated filename and line number."""
|
||||
|
||||
file_name = "unknown"
|
||||
"""The DMM file name the exception occurred in"""
|
||||
|
||||
line_number = 1
|
||||
"""The line the error occurred on"""
|
||||
|
||||
coordinates: Optional[str] = None
|
||||
"""The optional coordinates"""
|
||||
|
||||
pop_id: Optional[str] = None
|
||||
"""The optional pop ID"""
|
||||
|
||||
help: Optional[str] = None
|
||||
"""The optional help message"""
|
||||
|
||||
path_suggestion: Optional[str] = None
|
||||
"""The optional UpdatePaths suggestion snippet"""
|
||||
|
||||
dm_suggestion: Optional[str] = None
|
||||
"""The optional dm code suggestion snippet"""
|
||||
|
||||
dm_sub_suggestion: Optional[str] = None
|
||||
"""The optional dm code suggestion snippet for any subtype. Seperate for de-duping."""
|
||||
|
||||
def __init__(self, message: str, file_name: str, line_number = 1, path_suggestion = "", dm_suggestion = "", dm_sub_suggestion = ""):
|
||||
Exception.__init__(self, message)
|
||||
|
||||
self.file_name = file_name
|
||||
self.line_number = line_number
|
||||
self.path_suggestion = path_suggestion
|
||||
self.dm_suggestion = dm_suggestion
|
||||
self.dm_sub_suggestion = dm_sub_suggestion
|
||||
|
||||
class MapParseError(Exception):
|
||||
"""A parsing error that must be upgrading to a linting error by parse()."""
|
||||
pass
|
||||
Reference in New Issue
Block a user