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 #572 from iKostanOrg/master #573

Merged
merged 58 commits into from
Dec 24, 2024
Merged

Merge pull request #572 from iKostanOrg/master #573

merged 58 commits into from
Dec 24, 2024

Conversation

ikostan
Copy link
Member

@ikostan ikostan commented Dec 22, 2024

Merge from master

Summary by Sourcery

Add "Closest elevator" kata, tests and documentation.

New Features:

  • Add "Closest elevator" kata.

Tests:

  • Add tests for "Closest elevator" kata.

Copy link

sourcery-ai bot commented Dec 22, 2024

Reviewer's Guide by Sourcery

This pull request includes several updates and improvements to the test suites, enhancing their clarity, structure, and efficiency. Additionally, a new kata, "Closest elevator," has been added.

Sequence diagram for the Closest Elevator logic

sequenceDiagram
    participant C as Caller
    participant E as Elevator Function
    participant L as Left Elevator
    participant R as Right Elevator

    C->>E: elevator(left, right, call)
    E->>L: Check distance from left
    E->>R: Check distance from right
    alt both elevators at same distance
        E->>R: Choose right elevator
    else left closer
        E->>L: Choose left elevator
    else right closer
        E->>R: Choose right elevator
    end
    E->>C: Return chosen elevator ('left' or 'right')
Loading

Class diagram for the new Closest Elevator kata

classDiagram
    class elevator {
        +elevator(left: int, right: int, call: int) str
    }
    note for elevator "New kata implementation for finding
the closest elevator between left and right"
Loading

File-Level Changes

Change Details Files
Improved test suite structure and descriptions for more clarity and efficiency.
  • Added parameterized tests.
  • Improved test descriptions for better understanding of test cases.
  • Used allure library for enhanced reporting.
  • Improved code readability and efficiency.
kyu_8/README.md
kyu_8/alternating_case/test_alternating_case.py
kyu_8/century_from_year/test_century.py
kyu_8/check_the_exam/test_check_exam.py
kyu_8/counting_sheep/test_counting_sheep.py
kyu_8/convert_string_to_an_array/test_string_to_array.py
kyu_8/enumerable_magic_25/test_take.py
kyu_8/find_the_first_non_consecutive_number/test_first_non_consecutive.py
kyu_8/formatting_decimal_places_0/test_two_decimal_places.py
kyu_8/grasshopper_check_for_factor/test_check_for_factor.py
kyu_8/grasshopper_messi_goals_function/test_messi_goals_function.py
kyu_8/grasshopper_personalized_message/test_grasshopper_personalized_message.py
kyu_8/grasshopper_summation/test_summation.py
kyu_8/greek_sort/test_greek_comparator.py
kyu_8/holiday_vi_shark_pontoon/test_shark.py
kyu_8/is_it_a_palindrome/test_is_palindrome.py
kyu_8/is_your_period_late/test_is_your_period_late.py
kyu_8/keep_hydrated/test_keep_hydrated.py
kyu_8/keep_up_the_hoop/test_hoop_count.py
kyu_8/logical_calculator/test_logical_calculator.py
kyu_8/make_upper_case/test_make_upper_case.py
kyu_8/multiply/test_multiply.py
kyu_8/my_head_is_at_the_wrong_end/test_fix_the_meerkat.py
kyu_8/remove_first_and_last_character/test_remove_char.py
kyu_8/remove_string_spaces/test_remove_string_spaces.py
kyu_8/reversed_strings/test_reversed_strings.py
kyu_8/set_alarm/test_set_alarm.py
kyu_8/surface_area_and_volume_of_box/test_get_size.py
kyu_8/swap_values/test_swap_values.py
kyu_8/terminal_game_move_function/test_terminal_game_move_function.py
kyu_8/the_feast_of_many_beasts/test_feast.py
kyu_8/third_angle_of_triangle/test_third_angle_of_triangle.py
kyu_8/well_of_ideas_easy_version/test_well_of_ideas_easy_version.py
kyu_8/will_there_be_enough_space/test_enough.py
kyu_8/will_you_make_it/test_zero_fuel.py
kyu_8/wolf_in_sheep_clothing/test_wolf_in_sheep_clothing.py
Added "Closest elevator" kata and associated test file.
  • Implemented the elevator function to determine the closest elevator.
  • Created a comprehensive test suite for the elevator function.
  • Updated project documentation and configuration files.
kyu_8/closest_elevator/closest_elevator.py
kyu_8/closest_elevator/test_closest_elevator.py
kyu_8/closest_elevator/__init__.py
kyu_8/closest_elevator/README.md
kyu_8/README.md
docs/kyu_8/kyu_8.closest_elevator.rst
docs/kyu_8/kyu_8.rst
kyu_8/__init__.py
.github/workflows/pydocstyle_kyu8.yml

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

@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. Here's why:

  • We don't review packaging changes - Let us know if you'd like us to change this.
  • All of the files are larger than we can process. We're working on it!

Copy link

codecov bot commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.39%. Comparing base (94ac9d5) to head (f1d31ca).
Report is 60 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #573   +/-   ##
=======================================
  Coverage   90.39%   90.39%           
=======================================
  Files         172      172           
  Lines        2550     2550           
=======================================
  Hits         2305     2305           
  Misses        245      245           

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

Copy link

codeclimate bot commented Dec 22, 2024

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

The test coverage on the diff in this pull request is 100.0% (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_8/greek_sort/evaluator.py:10 in public function `evaluator`:
        D401: First line should be in imperative mood (perhaps 'Evaluate', not 'Evaluator')

        [Docstring] prescribes the function or method's effect as a command:
        ("Do this", "Return that"), not as a description; e.g. don't write
        "Returns the pathname ...".
kyu_8/make_upper_case/make_upper_case.py:10 in public function `make_upper_case`:
        D401: First line should be in imperative mood; try rephrasing (found 'Function')

        [Docstring] prescribes the function or method's effect as a command:
        ("Do this", "Return that"), not as a description; e.g. don't write
        "Returns the pathname ...".
kyu_8/will_there_be_enough_space/enough.py:10 in public function `enough`:
        D401: First line should be in imperative mood; try rephrasing (found 'The')

        [Docstring] prescribes the function or method's effect as a command:
        ("Do this", "Return that"), not as a description; e.g. don't write
        "Returns the pathname ...".
kyu_8/keep_up_the_hoop/hoop_count.py:1 at module level:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/keep_up_the_hoop/hoop_count.py:1 at module level:
        D400: First line should end with a period (not 'p')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/keep_up_the_hoop/hoop_count.py:9 in public function `hoop_count`:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/keep_up_the_hoop/hoop_count.py:9 in public function `hoop_count`:
        D400: First line should end with a period (not 'e')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/keep_up_the_hoop/hoop_count.py:9 in public function `hoop_count`:
        D401: First line should be in imperative mood; try rephrasing (found 'A')

        [Docstring] prescribes the function or method's effect as a command:
        ("Do this", "Return that"), not as a description; e.g. don't write
        "Returns the pathname ...".

kyu_8/keep_up_the_hoop/__init__.py:1 at module level:
        D104: Missing docstring in public package

        All modules should normally have docstrings.  [...] all functions and
        classes exported by a module should also have docstrings. Public
        methods (including the __init__ constructor) should also have
        docstrings.
        Note: Public (exported) definitions are either those with names listed
              in __all__ variable (if present), or those that do not start
              with a single underscore.

kyu_8/keep_up_the_hoop/test_hoop_count.py:1 at module level:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/keep_up_the_hoop/test_hoop_count.py:1 at module level:
        D400: First line should end with a period (not 'p')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/keep_up_the_hoop/test_hoop_count.py:28 in public class `HoopCountTestCase`:
        D200: One-line docstring should fit on one line with quotes (found 3)

        The closing quotes are on the same line as the opening quotes.
        This looks better for one-liners.

kyu_8/keep_up_the_hoop/test_hoop_count.py:28 in public class `HoopCountTestCase`:
        D400: First line should end with a period (not 'n')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/keep_up_the_hoop/test_hoop_count.py:33 in public method `test_hoop_count_positive`:
        D400: First line should end with a period (not ')')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/keep_up_the_hoop/test_hoop_count.py:66 in public method `test_hoop_count_negative`:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/keep_up_the_hoop/test_hoop_count.py:66 in public method `test_hoop_count_negative`:
        D400: First line should end with a period (not ')')

        The [first line of a] docstring is a phrase ending in a period.
kyu_8/logical_calculator/test_logical_calculator.py:1 at module level:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/logical_calculator/test_logical_calculator.py:1 at module level:
        D400: First line should end with a period (not 'r')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/logical_calculator/test_logical_calculator.py:30 in public class `LogicalCalculatorTestCase`:
        D200: One-line docstring should fit on one line with quotes (found 3)

        The closing quotes are on the same line as the opening quotes.
        This looks better for one-liners.

kyu_8/logical_calculator/test_logical_calculator.py:30 in public class `LogicalCalculatorTestCase`:
        D400: First line should end with a period (not 'n')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/logical_calculator/test_logical_calculator.py:35 in public method `test_logical_calc_and`:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/logical_calculator/test_logical_calculator.py:35 in public method `test_logical_calc_and`:
        D400: First line should end with a period (not 'l')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/logical_calculator/test_logical_calculator.py:99 in public method `test_logical_calc_or`:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/logical_calculator/test_logical_calculator.py:99 in public method `test_logical_calc_or`:
        D400: First line should end with a period (not 'e')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/logical_calculator/test_logical_calculator.py:157 in public method `test_logical_calc_xor`:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/logical_calculator/test_logical_calculator.py:157 in public method `test_logical_calc_xor`:
        D400: First line should end with a period (not 'a')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/logical_calculator/__init__.py:1 at module level:
        D104: Missing docstring in public package

        All modules should normally have docstrings.  [...] all functions and
        classes exported by a module should also have docstrings. Public
        methods (including the __init__ constructor) should also have
        docstrings.
        Note: Public (exported) definitions are either those with names listed
              in __all__ variable (if present), or those that do not start
              with a single underscore.

kyu_8/logical_calculator/logical_calculator.py:1 at module level:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/logical_calculator/logical_calculator.py:1 at module level:
        D400: First line should end with a period (not 'r')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/logical_calculator/logical_calculator.py:9 in public function `logical_calc`:
        D401: First line should be in imperative mood (perhaps 'Calculate', not 'Calculates')

        [Docstring] prescribes the function or method's effect as a command:
        ("Do this", "Return that"), not as a description; e.g. don't write
        "Returns the pathname ...".
kyu_8/is_your_period_late/__init__.py:1 at module level:
        D104: Missing docstring in public package

        All modules should normally have docstrings.  [...] all functions and
        classes exported by a module should also have docstrings. Public
        methods (including the __init__ constructor) should also have
        docstrings.
        Note: Public (exported) definitions are either those with names listed
              in __all__ variable (if present), or those that do not start
              with a single underscore.

kyu_8/is_your_period_late/test_is_your_period_late.py:1 at module level:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/is_your_period_late/test_is_your_period_late.py:1 at module level:
        D400: First line should end with a period (not 'e')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/is_your_period_late/test_is_your_period_late.py:30 in public class `PeriodIsLateTestCase`:
        D200: One-line docstring should fit on one line with quotes (found 3)

        The closing quotes are on the same line as the opening quotes.
        This looks better for one-liners.

kyu_8/is_your_period_late/test_is_your_period_late.py:30 in public class `PeriodIsLateTestCase`:
        D400: First line should end with a period (not 'n')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/is_your_period_late/test_is_your_period_late.py:35 in public method `test_period_is_late_positive`:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/is_your_period_late/test_is_your_period_late.py:35 in public method `test_period_is_late_positive`:
        D400: First line should end with a period (not 's')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/is_your_period_late/test_is_your_period_late.py:98 in public method `test_period_is_late_negative`:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/is_your_period_late/test_is_your_period_late.py:98 in public method `test_period_is_late_negative`:
        D400: First line should end with a period (not 's')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/is_your_period_late/is_your_period_late.py:1 at module level:
        D205: 1 blank line required between summary line and description (found 0)

        Multi-line docstrings consist of a summary line just like a one-line
        docstring, followed by a blank line, followed by a more elaborate
        description. The summary line may be used by automatic indexing tools;
        it is important that it fits on one line and is separated from the
        rest of the docstring by a blank line.

kyu_8/is_your_period_late/is_your_period_late.py:1 at module level:
        D400: First line should end with a period (not 'e')

        The [first line of a] docstring is a phrase ending in a period.
kyu_8/set_alarm/test_set_alarm.py:31 in public class `SetAlarmTestCase`:
        D200: One-line docstring should fit on one line with quotes (found 3)

        The closing quotes are on the same line as the opening quotes.
        This looks better for one-liners.

kyu_8/set_alarm/test_set_alarm.py:31 in public class `SetAlarmTestCase`:
        D400: First line should end with a period (not 'n')

        The [first line of a] docstring is a phrase ending in a period.

kyu_8/set_alarm/test_set_alarm.py:49 in public method `test_set_alarm`:
        D412: No blank lines allowed between a section header and its content ('Examples')
kyu_8/set_alarm/test_set_alarm.py:47 in public method `test_set_alarm`:
        D412: No blank lines allowed between a section header and its content ('Examples')
kyu_8/logical_calculator/logical_calculator.py:10 in public function `logical_calc`:
        D401: First line should be in imperative mood (perhaps 'Calculate', not 'Calculates')

        [Docstring] prescribes the function or method's effect as a command:
        ("Do this", "Return that"), not as a description; e.g. don't write
        "Returns the pathname ...".
kyu_8/check_the_exam/check_exam.py:37 in public function `char_processor`:
        D401: First line should be in imperative mood (perhaps 'Process', not 'Processing')

        [Docstring] prescribes the function or method's effect as a command:
        ("Do this", "Return that"), not as a description; e.g. don't write
        "Returns the pathname ...".
kyu_8/well_of_ideas_easy_version/well_of_ideas_easy_version.py:12 in public function `well`:
        D400: First line should end with a period (not 'n')

        The [first line of a] docstring is a phrase ending in a period.
kyu_8/greek_sort/evaluator.py:10 in public function `evaluator`:
        D401: First line should be in imperative mood (perhaps 'Evaluate', not 'evaluator')

        [Docstring] prescribes the function or method's effect as a command:
        ("Do this", "Return that"), not as a description; e.g. don't write
        "Returns the pathname ...".
@ikostan
Copy link
Member Author

ikostan commented Dec 24, 2024

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

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.

@ikostan ikostan merged commit 8fdde8e into master Dec 24, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant