Skip to content

Fix linter report formatting#3003

Open
Khauazin wants to merge 1 commit intomate-academy:masterfrom
Khauazin:develop
Open

Fix linter report formatting#3003
Khauazin wants to merge 1 commit intomate-academy:masterfrom
Khauazin:develop

Conversation

@Khauazin
Copy link

foi adicionado os trexos:
em C:\Users\supor\Desktop\tarefa\py-linter-formatter\app\main.py
def format_linter_error(error: dict) -> dict:
return {
"line": error["line_number"],
"column": error["column_number"],
"message": error["text"],
"name": error["code"],
"source": "flake8",
}

def format_single_linter_file(file_path: str, errors: list) -> dict:
return {
"path": file_path,
"status": "failed" if errors else "passed",
"errors": [format_linter_error(error) for error in errors],
}

def format_linter_report(linter_report: dict) -> list:
return [
format_single_linter_file(file_path, errors)
for file_path, errors in linter_report.items()
]

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

I am approving your solution because it fully meets the functional and structural requirements of the task. All three functions are implemented, each uses only a single return statement, and the helper functions are correctly reused (format_linter_error inside format_single_linter_file, and that inside format_linter_report). The output structures match the required format for errors, per-file summaries, and the overall linter report, so this should integrate cleanly with the expected tooling.

There are no critical or blocking issues: the code should run correctly and produce the right results. As optional refinements, you could consider making the ordering of files deterministic (e.g., iterating over sorted(linter_report.items())) if future tests rely on exact list order, and adding brief docstrings or comments to clarify the intent of each formatter. Overall, this is a clean, requirement-compliant implementation—well done.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Copy link

@meruyme meruyme left a comment

Choose a reason for hiding this comment

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

Parabéns pelo trabalho, Khauan! Seu código está correto, por isso estou aprovando sua tarefa.

Continue assim!

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