diff --git a/app/__pycache__/main.cpython-311.pyc b/app/__pycache__/main.cpython-311.pyc new file mode 100644 index 00000000..18272b4b Binary files /dev/null and b/app/__pycache__/main.cpython-311.pyc differ diff --git a/app/main.py b/app/main.py index 20463c45..df85cb52 100644 --- a/app/main.py +++ b/app/main.py @@ -1,13 +1,19 @@ def format_linter_error(error: dict) -> dict: - # write your code here - pass + return {"line": error["line_number"], + "column": error["column_number"], + "message": error["text"], + "name": error["code"], + "source": "flake8"} def format_single_linter_file(file_path: str, errors: list) -> dict: - # write your code here - pass + return {"errors": [format_linter_error(error) for error in errors], + "path": file_path, + "status": "failed" if len(errors) > 0 else "passed"} def format_linter_report(linter_report: dict) -> list: - # write your code here - pass + return [ + format_single_linter_file(path, error) + for path, error in linter_report.items() + ] diff --git a/tests/__pycache__/__init__.cpython-311.pyc b/tests/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 00000000..0efeff0f Binary files /dev/null and b/tests/__pycache__/__init__.cpython-311.pyc differ diff --git a/tests/__pycache__/test_main.cpython-311-pytest-7.1.3.pyc b/tests/__pycache__/test_main.cpython-311-pytest-7.1.3.pyc new file mode 100644 index 00000000..46082628 Binary files /dev/null and b/tests/__pycache__/test_main.cpython-311-pytest-7.1.3.pyc differ