From 2501df6b93171ab28e73ef5e9fc003fc8db0797d Mon Sep 17 00:00:00 2001 From: Matheus Felipe <50463866+matheusfelipeog@users.noreply.github.com> Date: Sun, 16 Jan 2022 01:08:49 -0300 Subject: [PATCH] Create a error message generator --- scripts/validate/format.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/validate/format.py b/scripts/validate/format.py index b3e06d53..0cc66fc9 100644 --- a/scripts/validate/format.py +++ b/scripts/validate/format.py @@ -23,3 +23,8 @@ title_links = [] anchor_re = re.compile(anchor + '\s(.+)') section_title_re = re.compile('\*\s\[(.*)\]') link_re = re.compile('\[(.+)\]\((http.*)\)') + + +def error_message(line_number: int, message: str) -> str: + line = line_number + 1 + return f'(L{line:03d}) {message}'