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

Merge pull request #561 from iKostanOrg/master #562

Merged
merged 106 commits into from
Dec 19, 2024
Merged

Merge pull request #561 from iKostanOrg/master #562

merged 106 commits into from
Dec 19, 2024

Conversation

ikostan
Copy link
Member

@ikostan ikostan commented Dec 15, 2024

Merge pull request #560 from iKostanOrg/kyu6

Summary by Sourcery

Tests:

  • Add parameterized tests to test suites.

Copy link
Contributor

sourcery-ai bot commented Dec 15, 2024

Reviewer's Guide by Sourcery

This pull request refactors test cases in test_array_diff.py, test_find_missing_number.py, test_unique_in_order.py, test_string_transformer.py, test_epidemic.py, test_solution.py, test_has_subpattern.py, test_stock_list.py, test_group_cities.py, test_odd_row.py, test_valid_braces.py, test_solve.py, test_decipher_this.py, test_sequence.py, test_checkchoose.py, test_calculate_damage.py, test_encrypt_this.py, test_tickets.py, test_easy_diagonal.py, test_find_the_odd_int.py, test_namelist.py, test_parts_sum.py, test_order.py, test_longest_repetition.py, test_sort_array.py, and test_potion.py to use parameterized tests. It also adds a new GitHub Actions workflow to enforce Python docstring style checks using pydocstyle.

Class diagram for DefaultList implementation

classDiagram
    class DefaultList {
        -list __lst
        -str default_value
        +__init__(lst: list, default_value: str)
        +__getitem__(i: int)
        +extend(items: list)
        +append(item)
        +pop(item)
        +remove(item)
        +insert(index: int, item)
    }
    note for DefaultList "Implements a list with default value for out of range indices"
Loading

Class diagram for Potion implementation

classDiagram
    class Potion {
        -Tuple _color
        -int _volume
        +__init__(color: Tuple, volume: int)
        +mix(other: Potion) Potion
        +volume() int
        +volume(value: int)
        +color() tuple
        +color(value: Tuple)
    }
    note for Potion "Represents a potion with color and volume properties"
Loading

File-Level Changes

Change Details Files
Refactor test cases to use parameterized tests
  • Replaced multiple test cases with a single parameterized test case.
kyu_6/number_zoo_patrol/test_find_missing_number.py
kyu_6/unique_in_order/test_unique_in_order.py
kyu_6/string_transformer/test_string_transformer.py
kyu_6/disease_spread/test_epidemic.py
kyu_6/scheduling/test_solution.py
kyu_6/string_subpattern_recognition_2/test_has_subpattern.py
kyu_6/help_the_bookseller/test_stock_list.py
kyu_6/rotate_the_letters_of_each_element/test_group_cities.py
kyu_6/row_of_the_odd_triangle/test_odd_row.py
kyu_6/valid_braces/test_valid_braces.py
kyu_6/casino_chips/test_solve.py
kyu_6/decipher_this/test_decipher_this.py
kyu_6/no_arithmetic_progressions/test_sequence.py
kyu_6/color_choice/test_checkchoose.py
kyu_6/pokemon_damage_calculator/test_calculate_damage.py
kyu_6/encrypt_this/test_encrypt_this.py
kyu_6/vasya_clerk/test_tickets.py
kyu_6/easy_diagonal/test_easy_diagonal.py
kyu_6/find_the_odd_int/test_find_the_odd_int.py
kyu_6/format_string_of_names/test_namelist.py
kyu_6/sums_of_parts/test_solution.py
kyu_6/your_order_please/test_order.py
kyu_6/longest_repetition/test_longest_repetition.py
kyu_6/sort_the_odd/test_sort_array.py
kyu_6/array_diff/test_array_diff.py
Add a new GitHub Actions workflow to enforce Python docstring style checks using pydocstyle
  • Created a new workflow file named pydocstyle_kyu6.yml.
.github/workflows/pydocstyle_kyu6.yml
Updated docstrings in various test files
  • Improved clarity and conciseness of test case descriptions.
kyu_6/number_zoo_patrol/test_find_missing_number.py
kyu_6/unique_in_order/test_unique_in_order.py
kyu_6/string_transformer/test_string_transformer.py
kyu_6/disease_spread/test_epidemic.py
kyu_6/scheduling/test_solution.py
kyu_6/string_subpattern_recognition_2/test_has_subpattern.py
kyu_6/help_the_bookseller/test_stock_list.py
kyu_6/rotate_the_letters_of_each_element/test_group_cities.py
kyu_6/row_of_the_odd_triangle/test_odd_row.py
kyu_6/valid_braces/test_valid_braces.py
kyu_6/casino_chips/test_solve.py
kyu_6/decipher_this/test_decipher_this.py
kyu_6/no_arithmetic_progressions/test_sequence.py
kyu_6/color_choice/test_checkchoose.py
kyu_6/pokemon_damage_calculator/test_calculate_damage.py
kyu_6/encrypt_this/test_encrypt_this.py
kyu_6/vasya_clerk/test_tickets.py
kyu_6/easy_diagonal/test_easy_diagonal.py
kyu_6/find_the_odd_int/test_find_the_odd_int.py
kyu_6/format_string_of_names/test_namelist.py
kyu_6/sums_of_parts/test_solution.py
kyu_6/your_order_please/test_order.py
kyu_6/longest_repetition/test_longest_repetition.py
kyu_6/sort_the_odd/test_sort_array.py
kyu_6/potion_class_101/test_potion.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

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

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: 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 and I'll use the feedback to improve your reviews.

Copy link

codecov bot commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.34%. Comparing base (c70acf3) to head (8f7dce0).
Report is 109 commits behind head on master.

Files with missing lines Patch % Lines
kyu_6/no_arithmetic_progressions/sequence.py 66.66% 1 Missing ⚠️
kyu_6/potion_class_101/potion.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #562   +/-   ##
=======================================
  Coverage   90.34%   90.34%           
=======================================
  Files         172      172           
  Lines        2537     2537           
=======================================
  Hits         2292     2292           
  Misses        245      245           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codeclimate bot commented Dec 15, 2024

Code Climate has analyzed commit 8f7dce0 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 94.1% (50% is the threshold).

This pull request will bring the total coverage in the repository to 90.3% (0.0% change).

View more on Code Climate.

kyu_6/format_string_of_names/test_namelist.py:1 at module level:
        D301: Use r""" if any backslashes in a docstring

        Use r"""raw triple double quotes""" if you use any backslashes
        (\) in your docstrings.
        Exceptions are backslashes for line-continuation and unicode escape
        sequences \N... and \u... These are considered intended unescaped
        content in docstrings.

kyu_6/format_string_of_names/solution.py:1 at module level:
        D301: Use r""" if any backslashes in a docstring

        Use r"""raw triple double quotes""" if you use any backslashes
        (\) in your docstrings.
        Exceptions are backslashes for line-continuation and unicode escape
        sequences \N... and \u... These are considered intended unescaped
        content in docstrings.
kyu_6/who_likes_it/test_likes_function.py:33 in public class `LikesTestCase`:
        D400: First line should end with a period (not 'n')

        The [first line of a] docstring is a phrase ending in a period.
kyu_6/format_string_of_names/test_namelist.py:1 at module level:
        D301: Use r""" if any backslashes in a docstring

        Use r"""raw triple double quotes""" if you use any backslashes
        (\) in your docstrings.
        Exceptions are backslashes for line-continuation and unicode escape
        sequences \N... and \u... These are considered intended unescaped
        content in docstrings.
@ikostan
Copy link
Member Author

ikostan commented Dec 19, 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.

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

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 3 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: 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 and I'll use the feedback to improve your reviews.

kyu_6/default_list/default_list.py Outdated Show resolved Hide resolved
kyu_6/vasya_clerk/tickets.py Outdated Show resolved Hide resolved
kyu_6/help_the_bookseller/test_stock_list.py Outdated Show resolved Hide resolved
kyu_6/default_list/test_default_list.py Show resolved Hide resolved
kyu_6/duplicate_encoder/duplicate_encode.py Show resolved Hide resolved
kyu_6/find_the_odd_int/find_the_odd_int.py Show resolved Hide resolved
kyu_6/sums_of_parts/solution.py Show resolved Hide resolved
No name 'to_table' in module 'kyu_6.array_to_html_table'

kyu_6/array_to_html_table/
test_list_to_html_table.py

10
import allure
11
from utils.log_func import print_log
12
from kyu_6.array_to_html_table.to_table import to_table
13

Time to fix: 5 minutes
no-name-in-module (E0611)
Why is this an issue?
No name %r in module %r Used when a name cannot be found in a module.
suggestion (testing): Consider adding a test case with duplicate categories in the stock list.

This would ensure the function correctly handles scenarios where multiple books belong to the same category.
@ikostan ikostan merged commit da16087 into master Dec 19, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant