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 #1663

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

Solution #1663

wants to merge 3 commits into from

Conversation

Den-k0
Copy link

@Den-k0 Den-k0 commented Sep 23, 2024

No description provided.

Copy link

@dxrrkwm dxrrkwm left a 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": [
Copy link
Contributor

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 [
Copy link
Contributor

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
Comment on lines 1 to 8
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"
}

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)

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

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.

5 participants