-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution #1663
base: master
Are you sure you want to change the base?
Solution #1663
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done😇
# write your code here | ||
pass | ||
return { | ||
"errors": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to reuse format_linter_error
to format errors
|
||
|
||
def format_linter_report(linter_report: dict) -> list: | ||
# write your code here | ||
pass | ||
return [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here you can reuse format_single_linter_file
app/main.py
Outdated
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" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use get()
method for dict, in case if you don't have some key
inside of your dict and you will try to get it with [key]
- it will give you error
app/main.py
Outdated
# write your code here | ||
pass | ||
return [ | ||
format_single_linter_file(filepath, issues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python is using snake_case. So, it should be file_path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
No description provided.