Skip to content
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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

skyfoxwork
Copy link

No description provided.

@skyfoxwork skyfoxwork changed the title Develop Solution-py-linter-formatter Sep 8, 2024
Copy link
Contributor

@Nattalli Nattalli left a 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
Comment on lines 21 to 24
return [
format_single_linter_file(key, value)
for key, value in linter_report.items()
]
Copy link
Contributor

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
Comment on lines 3 to 6
("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"
Copy link
Contributor

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
Comment on lines 12 to 16
("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")
Copy link
Contributor

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

Copy link
Contributor

@Nattalli Nattalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants