iterative / shtab

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

add `default_complete` option (Sourcery refactored) #84

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Pull Request #83 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

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:

Review changes via command line

To manually merge these changes, make sure you're on the default_complete branch, then run:

git fetch origin sourcery/default_complete
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.07%.

Quality metrics Before After Change
Complexity 42.09 ⛔ 41.26 ⛔ -0.83 👍
Method Length 112.03 🙂 114.41 🙂 2.38 👎
Working memory 18.28 ⛔ 18.29 ⛔ 0.01 👎
Quality 29.44% 😞 29.51% 😞 0.07% 👍
Other metrics Before After Change
Lines 1068 1126 58
Changed files Quality Before Quality After Quality Change
shtab/init.py 29.44% 😞 29.51% 😞 0.07% 👍

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 ⛔ 532 ⛔ 25 ⛔ 2.89% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shtab/init.py complete_zsh 61 ⛔ 758 ⛔ 27 ⛔ 3.11% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shtab/init.py get_bash_commands.recurse 58 ⛔ 478 ⛔ 25 ⛔ 4.52% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shtab/init.py complete_tcsh 53 ⛔ 411 ⛔ 19 ⛔ 8.63% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shtab/init.py complete_zsh.recurse 17 🙂 213 ⛔ 16 ⛔ 32.81% 😞 Try splitting into smaller methods. 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!