Skip to content

Commit

Permalink
Implemented py-linter-formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
Kateryna Zadorozhna committed Jul 2, 2023
1 parent 088c990 commit c33acda
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
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": "passed" if errors == [] else "failed"
}


def format_linter_report(linter_report: dict) -> list:
# write your code here
pass
return [format_single_linter_file(key, linter_report[key]) for key in linter_report.keys()]

0 comments on commit c33acda

Please sign in to comment.