-
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-py-linter-formatter #1616
base: master
Are you sure you want to change the base?
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.
comments added
app/main.py
Outdated
return [ | ||
format_single_linter_file(key, value) | ||
for key, value in linter_report.items() | ||
] |
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.
don't use key, value
if you already know field names. for example file_path, errors
would be better
app/main.py
Outdated
("name" if key == "code" else "source" if key == "filename" else | ||
"message" if key == "text" else tuple(key.split("_"))[0]): | ||
("flake8" if key == "filename" else value) | ||
for key, value in error.items() if key != "physical_line" |
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.
not readable code. please, use static key names and choose the correct fields from the dictionary for those keys. for example:
"name": error["code"]
app/main.py
Outdated
("errors" if elem == "error" else elem): | ||
([format_linter_error(error) for error in errors] | ||
if elem == "error" else file_path if elem == "path" else | ||
"failed" if elem == "status" and errors != [] else "passed") | ||
for elem in ("error", "path", "status") |
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.
the same here. also, elem
is bad naming for variable
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.