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

Return list[str] when passed multiple values from python #53

Merged
merged 30 commits into from
Jun 7, 2024

Conversation

MusicalNinjaDad
Copy link
Owner

@MusicalNinjaDad MusicalNinjaDad commented Jun 7, 2024

Summary by Sourcery

This pull request introduces a new return type for the fizzbuzz function, allowing it to return either a single string or a list of strings based on the input. The documentation and tests have been updated accordingly to reflect these changes.

  • Enhancements:
    • Updated the fizzbuzzo3.fizzbuzz function to return a list of strings when passed a list or range of numbers, instead of a single concatenated string.
    • Enhanced the documentation to reflect the new return types for the fizzbuzz function, providing clearer examples and explanations.
    • fizzbuzzo3: Introduced a new return type FizzBuzzReturn to handle different return types for the fizzbuzz function, allowing it to return either a single string or a list of strings based on the input.
  • Documentation:
    • Added detailed documentation on how to implement and use the new FizzBuzzReturn type in docs/dev-build.md.
    • Updated the type hints and docstrings in python/fizzbuzz/fizzbuzzo3.pyi to reflect the new return types for the fizzbuzz function.
  • Tests:
    • Modified existing tests to check for the new return type (list of strings) when passing a list or range of numbers to the fizzbuzz function.
    • Added new test cases to ensure the fizzbuzz function returns an empty list for invalid slice ranges.
  • Chores:
    • Commented out the Python performance tests in tests/perftest.py to focus on Rust performance comparisons.

Copy link

sourcery-ai bot commented Jun 7, 2024

Reviewer's Guide by Sourcery

This pull request modifies the fizzbuzz function to return a list of strings when passed multiple values, instead of a single concatenated string. The changes involve updating the Rust implementation, Python interface, and associated documentation and tests.

File-Level Changes

Files Changes
rust/fizzbuzzo3/src/lib.rs
python/fizzbuzz/fizzbuzzo3.pyi
Updated the implementation and interface of the fizzbuzz function to return a list of strings when passed multiple values.
tests/test_fizzbuzzo3.py
tests/perftest.py
Updated tests to reflect the new return type and added performance tests for different return types.
docs/dev-build.md
tests/perf_results.md
Updated documentation to explain the new return type and added performance comparison results.

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
Owner Author

@MusicalNinjaDad MusicalNinjaDad left a comment

Choose a reason for hiding this comment

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

Fixes: #51

Copy link

@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.

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

Here's what I looked at during the review
  • 🟡 General issues: 7 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue 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.

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files
Flag Coverage Δ
fizzbuzz 93.84% <ø> (ø)
fizzbuzzo3 87.50% <100.00%> (ø)
python 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📢 Thoughts on this report? Let us know!

@MusicalNinjaDad
Copy link
Owner Author

@sourcery-ai review

Copy link

@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.

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

@MusicalNinjaDad MusicalNinjaDad merged commit 732d1a1 into main Jun 7, 2024
21 checks passed
@MusicalNinjaDad MusicalNinjaDad deleted the MusicalNinjaDad/issue51 branch June 7, 2024 08:53
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.

1 participant