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

Support compopt in completion functions (Sourcery refactored) #79

Closed
wants to merge 2 commits into from

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jun 8, 2022

Pull Request #78 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/78/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 Jun 8, 2022

Sourcery Code Quality Report

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 46.94 ⛔ 46.94 ⛔ 0.00
Method Length 135.50 😞 135.60 😞 0.10 👎
Working memory 1.75 ⭐ 1.75 ⭐ 0.00
Quality 25.94% 😞 25.94% 😞 0.00%
Other metrics Before After Change
Lines 761 768 7
Changed files Quality Before Quality After Quality Change
shtab/init.py 25.94% 😞 25.94% 😞 0.00%

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 ⛔ 587 ⛔ 1.23% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
shtab/init.py complete_zsh 62 ⛔ 894 ⛔ 2.38% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
shtab/init.py complete_tcsh 53 ⛔ 467 ⛔ 5.02% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
shtab/init.py complete_bash 2 ⭐ 105 🙂 11 😞 64.43% 🙂 Extract out complex expressions
shtab/init.py add_argument_to 4 ⭐ 88 🙂 11 😞 64.81% 🙂 Extract out complex expressions

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 Report

Merging #79 (030ec20) into master (cf19980) will decrease coverage by 0.05%.
The diff coverage is 71.42%.

@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
- Coverage   91.04%   90.99%   -0.06%     
==========================================
  Files           3        3              
  Lines         335      333       -2     
==========================================
- Hits          305      303       -2     
  Misses         30       30              
Impacted Files Coverage Δ
shtab/__init__.py 93.70% <71.42%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf19980...030ec20. Read the comment docs.

@omesser
Copy link
Contributor

omesser commented Apr 23, 2023

@0x2b3bfa0 - what's the history and current approach behind sourcery-ai bot?
I don't see it used that much - should we close this (and anything else issued by it)? or do you think we should double down on it?

@omesser omesser requested a review from 0x2b3bfa0 April 23, 2023 15:19
@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Apr 23, 2023

I believe @casperdcl enabled this in September 2021, but don't have any additional context. Not sure if it's worth the noise, albeit the f-strings suggestion on this pull request was nice. 🤷‍♂️

@omesser
Copy link
Contributor

omesser commented Apr 23, 2023

@0x2b3bfa0 - opened #135 in your honour.
Closing all sourcery PRs

🧹 🧹 🧹

@omesser omesser closed this Apr 23, 2023
@omesser omesser deleted the sourcery/pull-78 branch April 23, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Low priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants