Skip to content

Commit

Permalink
best
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo9siy committed Dec 21, 2024
1 parent 2cd836b commit 65e4992
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
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": [
{"line": error["line_number"],
"column": error["column_number"],
"message": error["text"],
"name": error["code"],
"source": "flake8"
} 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 [{
"path" : path,
"status" : "failed" if len(error_list) > 0 else "passed",
"errors": [{
"line" : error["line_number"],
"column" : error["column_number"],
"message" : error["text"],
"name" : error["code"],
"source": "flake8"
} for error in error_list]
}for path, error_list in linter_report]

0 comments on commit 65e4992

Please sign in to comment.