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

linter_formatter #1949

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

linter_formatter #1949

wants to merge 6 commits into from

Conversation

vhsrover
Copy link

No description provided.

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.

Thank you for your hard work on this Pull Request! 😊 There are a couple of critical issues that need to be addressed before we can approve it. Firstly, there's a typographical error in the key name 'colum' which should be corrected to 'column' in both the format_linter_error and format_single_linter_file functions. This typo could lead to key errors during execution. Secondly, the logic for handling empty error lists in format_single_linter_file is incorrect, as it will still iterate over the list even if it's empty. Please address these issues to ensure the code functions correctly. Keep up the great work, and don't hesitate to reach out if you need any help! 🚀

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

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

app/main.py Outdated

return {
"line": error["line_number"],
"colum": error["column_number"],

Choose a reason for hiding this comment

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

There is a typo in the key name 'colum'. It should be 'column' to match the expected key in the error dictionary.

app/main.py Outdated
return {
"errors": [{
"line": error["line_number"],
"colum": error["column_number"],

Choose a reason for hiding this comment

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

There is a typo in the key name 'colum'. It should be 'column' to match the expected key in the error dictionary.

app/main.py Outdated
"message": error["text"],
"name": error["code"],
"source": "flake8"
} if bool(errors) else [] for error in errors],

Choose a reason for hiding this comment

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

The logic here is incorrect. The list comprehension will still iterate over the errors list even if it's empty. Consider restructuring this logic to handle empty lists more effectively.

@vhsrover vhsrover closed this Jan 13, 2025
@vhsrover vhsrover reopened this Jan 13, 2025
Copy link

@vsmutok vsmutok left a comment

Choose a reason for hiding this comment

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

Please fix flake8 errors

@vhsrover vhsrover requested a review from vsmutok January 13, 2025 13:10
Copy link

@vasylhnatiuk vasylhnatiuk left a comment

Choose a reason for hiding this comment

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

fix tests

@vhsrover vhsrover requested a review from vasylhnatiuk January 13, 2025 15:51
Copy link

@vsmutok vsmutok left a comment

Choose a reason for hiding this comment

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

Good Job!

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.

4 participants