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 from master #591

Merged
merged 15 commits into from
Dec 26, 2024
Merged

Merge from master #591

merged 15 commits into from
Dec 26, 2024

Conversation

ikostan
Copy link
Member

@ikostan ikostan commented Dec 26, 2024

Summary by Sourcery

Add solution and tests for "101 Dalmatians - squash the bugs, not the dogs!" kata.

New Features:

  • Add the solution for the "101 Dalmatians - squash the bugs, not the dogs!" kata, which determines the appropriate response based on the number of dalmatians.
  • Add tests for the solution, covering different input values and expected outputs.
  • Include a README file with a description of the kata and a link to the original source on Codewars.

ikostan and others added 15 commits December 26, 2024 06:31
Merge pull request #587 from iKostanOrg/master
/.github/workflows/codecov.yml
  Error: 39:7 [comments-indentation] comment not indented like content
  Warning: 43:81 [line-length] line too long (127 > 80 characters)
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
./kyu_8/counting_sheep/test_counting_sheep.py:67:25: E128 continuation line under-indented for visual indent
                        f"There are 17 sheep in total, not {count_sheep(lst)}")
                        ^
./kyu_8/counting_sheep/test_counting_sheep.py:95:25: E128 continuation line under-indented for visual indent
                        f"There are 0 sheep in total, not {count_sheep(lst)}")
                        ^
./kyu_8/counting_sheep/test_counting_sheep.py:124:25: E128 continuation line under-indented for visual indent
                        f"There are 0 sheep in total, not {count_sheep(lst)}")
                        ^
./kyu_8/counting_sheep/test_counting_sheep.py:153:25: E128 continuation line under-indented for visual indent
                        f"There are 0 sheep in total, not {count_sheep(lst)}")
                        ^
4     E128 continuation line under-indented for visual indent
Explanation:¶
This is a quick way to streamline code slightly. Where a value is set on each branch of an if and then immediately returned, instead return it directly from each branch.

This has removed an unnecessary intermediate variable which we had to mentally track.
kyu_8/dalmatians_101_squash_bugs/solution.py:21:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
@ikostan ikostan added documentation Improvements or additions to documentation codewars Markdown Markdown rules violations pydocstyle labels Dec 26, 2024
@ikostan ikostan self-assigned this Dec 26, 2024
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Contributor

sourcery-ai bot commented Dec 26, 2024

Reviewer's Guide by Sourcery

This pull request implements a new kata, "101 Dalmatians - squash the bugs, not the dogs!", and updates the project's documentation and dependencies.

Sequence diagram for how_many_dalmatians function flow

sequenceDiagram
    participant C as Caller
    participant F as how_many_dalmatians
    C->>F: number: int
    alt number <= 10
        F-->>C: "Hardly any"
    else number <= 50
        F-->>C: "More than a handful!"
    else number == 101
        F-->>C: "101 DALMATIONS!!!"
    else default
        F-->>C: "Woah that's a lot of dogs!"
    end
Loading

Class diagram for the new 101 Dalmatians kata solution

classDiagram
    class how_many_dalmatians {
        +how_many_dalmatians(number: int) str
    }
    note for how_many_dalmatians "New function that returns a response based on number of dogs"
Loading

File-Level Changes

Change Details Files
Implemented the solution for the "101 Dalmatians" kata and added corresponding tests.
  • Created the how_many_dalmatians function to determine the appropriate response based on the number of dalmatians.
  • Added comprehensive unit tests using unittest, allure, and parameterized libraries.
  • Included a detailed README file with the kata description.
  • Created an __init__.py file to mark the directory as a package.
kyu_8/dalmatians_101_squash_bugs/solution.py
kyu_8/dalmatians_101_squash_bugs/test_how_many_dalmatians.py
kyu_8/dalmatians_101_squash_bugs/README.md
kyu_8/dalmatians_101_squash_bugs/__init__.py
Updated the main README file to include the new kata.
  • Added an entry for the "101 Dalmatians" kata to the list of completed katas in the README file.
kyu_8/README.md
Added Allure annotations to the test_counting_sheep.py file.
  • Added Allure annotations, such as @allure.epic, @allure.parent_suite, etc., to enhance test reporting and organization.
kyu_8/counting_sheep/test_counting_sheep.py
Updated the project's root README file with instructions for installing Allure.
  • Clarified the Allure installation instructions, including setting the execution policy and using Scoop.
README.md
Modified the Codecov workflow file to improve coverage reporting.
  • Added a step to print the current working directory for debugging purposes.
  • Disabled line length checks for a specific command in the workflow.
.github/workflows/codecov.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
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: 1 issue found
  • 🟢 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.

@@ -251,10 +250,10 @@ Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
Install from [Scoop](https://scoop.sh/#/):

1. Make sure Scoop is installed. See [the installation instructions on GitHub](https://github.com/ScoopInstaller/Install#readme).
2. Make sure `Java version 8 or above` installed, and its directory is specified
2. Make sure `Java version 8 or higher` installed, and its directory is specified
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (typo): Typo: Missing period.

There should be a period at the end of the sentence: "Make sure Java version 8 or higher installed, and its directory is specified."

Suggested change
2. Make sure `Java version 8 or higher` installed, and its directory is specified
2. Make sure `Java version 8 or higher` installed, and its directory is specified.

Comment on lines +27 to +30
if number == 101:
return dogs[3]

return dogs[2]
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (code-quality): We've found these issues:

Suggested change
if number == 101:
return dogs[3]
return dogs[2]
return dogs[3] if number == 101 else dogs[2]

@ikostan ikostan merged commit acc88ac into Documentation Dec 26, 2024
33 of 35 checks passed
ikostan added a commit that referenced this pull request Dec 26, 2024
Merge pull request #591 from iKostanOrg/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codewars documentation Improvements or additions to documentation Markdown Markdown rules violations pydocstyle
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant