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

fix sourcery's suggestions #22

Merged
merged 3 commits into from
Jun 7, 2024
Merged

fix sourcery's suggestions #22

merged 3 commits into from
Jun 7, 2024

Conversation

bleudev
Copy link
Member

@bleudev bleudev commented Jun 7, 2024

closes #21

Summary by Sourcery

This pull request addresses several issues in the UDict class, including fixing dictionary initialization, item setting logic, length calculation, iteration, and boolean checks. Additionally, new tests have been added to verify these fixes and ensure proper exception handling.

  • Bug Fixes:
    • Fixed incorrect handling of dictionary initialization in UDict class.
    • Corrected the logic for setting item values in UDict to handle lists and tuples properly.
    • Fixed the length calculation method to return the correct dictionary length.
    • Corrected the iteration method to iterate over dictionary items instead of a non-existent 'items' attribute.
    • Fixed the boolean check method to use the correct magic method 'bool' instead of 'nonzero'.
  • Tests:
    • Added tests to verify the behavior of UDict initialization with different parameters.
    • Included tests to check the handling of non-existent keys in UDict.
    • Added tests to ensure proper exception handling in the 'get' method of UDict.

@bleudev bleudev added bug Something isn't working invalid This doesn't seem right labels Jun 7, 2024
@bleudev bleudev added this to the 1.0 milestone Jun 7, 2024
@bleudev bleudev self-assigned this Jun 7, 2024
@bleudev bleudev linked an issue Jun 7, 2024 that may be closed by this pull request
Copy link
Contributor

sourcery-ai bot commented Jun 7, 2024

Reviewer's Guide by Sourcery

This pull request addresses issue #21 by implementing several suggestions from Sourcery to improve the code quality and functionality of the UDict class and its associated tests. The changes include refactoring code for better readability, adding new test cases, and fixing existing ones.

File-Level Changes

Files Changes
tests/test_udict.py
ufpy/udict.py
Refactored methods for better readability and efficiency, added new test cases, and fixed existing ones to ensure comprehensive coverage and correct functionality.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Привет, @bleudev - я просмотрел ваши изменения, и они выглядят отлично!

Вот что я рассмотрел во время проверки
  • 🟡 Общие проблемы: найдено 3 проблемы
  • 🟢 Безопасность: все выглядит хорошо
  • 🟡 Тестирование: найдено 3 проблемы
  • 🟢 Сложность: все выглядит хорошо

Sourcery бесплатен для open source - если вам нравятся наши обзоры, пожалуйста, подумайте о том, чтобы поделиться ими ✨
Помогите мне быть полезнее! Пожалуйста, нажмите 👍 или 👎 на каждый комментарий, чтобы сообщить, был ли он полезен.
Original comment in English

Hey @bleudev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 3 issues found
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

ufpy/udict.py Show resolved Hide resolved
ufpy/udict.py Show resolved Hide resolved
ufpy/udict.py Show resolved Hide resolved
tests/test_udict.py Show resolved Hide resolved
tests/test_udict.py Show resolved Hide resolved
tests/test_udict.py Show resolved Hide resolved
@bleudev
Copy link
Member Author

bleudev commented Jun 7, 2024

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Мы пропустили проверку этого pull request. Похоже, что мы уже проверили этот pull request.

Original comment in English

We have skipped reviewing this pull request. It looks like we've already reviewed this pull request.

Copy link
Member Author

@bleudev bleudev left a comment

Choose a reason for hiding this comment

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

Approving this PR to be merge!

@bleudev bleudev merged commit 2afd10a into main Jun 7, 2024
2 checks passed
@bleudev bleudev deleted the sourcery-suggestions branch June 7, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix sourcery's suggestions
1 participant