-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cd836b
commit 0d80b4c
Showing
1 changed file
with
17 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
# from statistics import pstdev | ||
|
||
|
||
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(er) for er in errors], | ||
"path" : file_path, | ||
"status" : "failed" if errors else "passed"} | ||
|
||
|
||
def format_linter_report(linter_report: dict) -> list: | ||
# write your code here | ||
pass | ||
return [ | ||
format_single_linter_file(path, er) | ||
for path, er in linter_report.items()] |