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 #92 (Sourcery refactored) #94

Closed
wants to merge 6 commits into from
Closed

Fix #92 (Sourcery refactored) #94

wants to merge 6 commits into from

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Aug 28, 2022

Pull Request #93 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/iterative/shtab pull/93/head
    git merge --ff-only FETCH_HEAD
    git push

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Help us improve this pull request!

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Aug 28, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.66%.

Quality metrics Before After Change
Complexity 28.85 😞 29.32 😞 0.47 👎
Method Length 100.54 🙂 102.17 🙂 1.63 👎
Working memory 3.61 ⭐ 3.70 ⭐ 0.09 👎
Quality 46.16% 😞 45.50% 😞 -0.66% 👎
Other metrics Before After Change
Lines 1009 1030 21
Changed files Quality Before Quality After Quality Change
shtab/init.py 25.93% 😞 25.34% 😞 -0.59% 👎
tests/test_shtab.py 76.78% ⭐ 76.72% ⭐ -0.06% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
shtab/init.py get_bash_commands 78 ⛔ 590 ⛔ 1.22% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
shtab/init.py complete_zsh 64 ⛔ 960 ⛔ 2.11% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
shtab/init.py complete_tcsh 53 ⛔ 470 ⛔ 4.99% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
tests/test_shtab.py test_add_argument_to_positional 1 ⭐ 171 😞 9 🙂 61.90% 🙂 Try splitting into smaller methods
tests/test_shtab.py test_subparser_aliases 1 ⭐ 172 😞 8 🙂 64.02% 🙂 Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2022

Codecov Report

Merging #94 (eb1116c) into master (4c0170c) will decrease coverage by 0.21%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   91.04%   90.82%   -0.22%     
==========================================
  Files           3        3              
  Lines         335      338       +3     
==========================================
+ Hits          305      307       +2     
- Misses         30       31       +1     
Impacted Files Coverage Δ
shtab/__init__.py 93.47% <83.33%> (-0.28%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-93 branch 4 times, most recently from ab55145 to 221b4bb Compare August 28, 2022 06:15
@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-93 branch 2 times, most recently from 5cc50d4 to 9d3ba67 Compare October 29, 2022 08:09
@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-93 branch 2 times, most recently from da24de2 to 626061d Compare November 18, 2022 21:08
Freed-Wu and others added 6 commits November 18, 2022 22:08
Change `(- :)` to `(- : *)` for zsh
Add format_positional(opt) to all_commands and change zsh template to fix #91, and use argparse.{ONE_OR_MORE, ZERO_OR_MORE, REMAINDER} to replace raw string
@omesser omesser closed this Apr 23, 2023
@casperdcl casperdcl deleted the sourcery/pull-93 branch July 28, 2023 20:48
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.

4 participants