iterative / shtab

↔️ Automagic shell tab completion for Python CLI applications
https://docs.iterative.ai/shtab
Other
375 stars 34 forks source link

Support compopt in completion functions (Sourcery refactored) #79

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 2 years ago

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] commented 2 years ago

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:

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 commented 2 years ago

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.

omesser commented 1 year ago

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

0x2b3bfa0 commented 1 year ago

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 commented 1 year ago

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

🧹 🧹 🧹