-
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 #723
base: master
Are you sure you want to change the base?
Solution #723
Conversation
app/main.py
Outdated
"line": error["line_number"], | ||
"column": error["column_number"], | ||
"message": error["text"], | ||
"name": error["code"], |
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 preferable to use get() method instead of parenthesis everywhere for getting value by key to avoid KeyError
app/main.py
Outdated
"errors": [ | ||
{ | ||
"line": error["line_number"], | ||
"column": error["column_number"], | ||
"message": error["text"], | ||
"name": error["code"], | ||
"source": "flake8" | ||
} | ||
for error in 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.
use format_linter_error() function here
app/main.py
Outdated
{ | ||
"errors": [ | ||
{ | ||
"line": error["line_number"], | ||
"column": error["column_number"], | ||
"message": error["text"], | ||
"name": error["code"], | ||
"source": "flake8" | ||
} | ||
for error in file_errors | ||
], | ||
"path": file_path, | ||
"status": "failed" if file_errors else "passed" | ||
} |
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 format_single_linter_file() function here
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.
Good job
Have a nice day)