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

implement py-linter-formatter #1637

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

Conversation

94nj111
Copy link

@94nj111 94nj111 commented Sep 16, 2024

No description provided.

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
# write your code here
pass
return {
"errors": ([format_linter_error(error) for error in errors]),
Copy link
Contributor

Choose a reason for hiding this comment

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

not a mistake, but you don't need to use additional braces ()- list comprehension is good enough without them

app/main.py Outdated
return {
"errors": ([format_linter_error(error) for error in errors]),
"path": file_path,
"status": ("failed" if errors else "passed")
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 with braces here

app/main.py Outdated
Comment on lines 20 to 21
return [format_single_linter_file(path, linter_report.get(path))
for path in linter_report]
Copy link
Contributor

Choose a reason for hiding this comment

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

this code is correct but a little bit complex to understand. I believe that using .items() can make it more readable, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

also, I don't like that you use 2 different code styles in 1 file. the example from guideline:

Знімок екрана 2024-09-18 о 15 02 25

both examples are good but use one:)

app/main.py Outdated
# write your code here
pass
return [
format_single_linter_file(*path) for path 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.

is it correct to name two items just a path? Probably it. would be better to use 2 variables and give them correct name, where first would be really a path

@94nj111
Copy link
Author

94nj111 commented Sep 23, 2024

maybe this name would be better?

Copy link
Contributor

@Y-Havryliv Y-Havryliv left a comment

Choose a reason for hiding this comment

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

gj!

pass
return [
format_single_linter_file(*path_and_errors)
for path_and_errors in linter_report.items()
Copy link
Contributor

@Y-Havryliv Y-Havryliv Sep 23, 2024

Choose a reason for hiding this comment

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

it would be better to use two variables, smth like this:
for file, report in linter_report.items()
but ur solution is also ok

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.

3 participants