diff --git a/app/main.py b/app/main.py index 20463c45..da7a4536 100644 --- a/app/main.py +++ b/app/main.py @@ -1,13 +1,25 @@ def format_linter_error(error: dict) -> dict: - # write your code here + return { + "line": error["line_number"], + "column": error["column_number"], + "message": error["text"], + "name": error["filename"], + "source": "flake8" + } pass def format_single_linter_file(file_path: str, errors: list) -> dict: - # write your code here + return { + "errors": [error for error in errors], + "path": file_path, + "status": "failed" if errors else "passed", + } pass def format_linter_report(linter_report: dict) -> list: - # write your code here + return [ + (file_path, errors) for file_path, errors in linter_report.items() + ] pass