shtab icon indicating copy to clipboard operation
shtab copied to clipboard

Support compopt in completion functions (Sourcery refactored)

Open sourcery-ai[bot] opened this issue 3 years ago • 2 comments

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[bot] avatar Jun 08 '22 13:06 sourcery-ai[bot]

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!

sourcery-ai[bot] avatar Jun 08 '22 13:06 sourcery-ai[bot]

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%) :arrow_down:

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.

codecov-commenter avatar Jun 08 '22 13:06 codecov-commenter

@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 avatar Apr 23 '23 15:04 omesser

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. 🤷‍♂️

0x2b3bfa0 avatar Apr 23 '23 19:04 0x2b3bfa0

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

🧹 🧹 🧹

omesser avatar Apr 23 '23 21:04 omesser