From 05b2547508edc13c839d4cea06fa3b881b29fdba Mon Sep 17 00:00:00 2001 From: Bondarenko Kirill Date: Wed, 9 Oct 2024 17:19:19 +0300 Subject: [PATCH] Update main.py --- app/main.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/main.py b/app/main.py index 20463c45..e4d51e98 100644 --- a/app/main.py +++ b/app/main.py @@ -1,13 +1,16 @@ def format_linter_error(error: dict) -> dict: - # write your code here - pass + return { + "line": error["line"], + "message": error["message"], + "severity": error["severity"] + } def format_single_linter_file(file_path: str, errors: list) -> dict: - # write your code here - pass + formatted_errors = [format_linter_error(error) for error in errors] + return {file_path: formatted_errors} def format_linter_report(linter_report: dict) -> list: - # write your code here - pass + return [format_single_linter_file(file_path, errors) + for file_path, errors in linter_report.items()]