iterative / shtab

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

Fix #89 #114

Closed Freed-Wu closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 5.00 ⭐ 4.85 ⭐ -0.15 👍
Method Length 103.33 🙂 105.33 🙂 2.00 👎
Working memory 5.50 ⭐ 5.45 ⭐ -0.05 👍
Quality 70.21% 🙂 70.33% 🙂 0.12% 👍
Other metrics Before After Change
Lines 54 55 1
Changed files Quality Before Quality After Quality Change
shtab/main.py 70.21% 🙂 70.33% 🙂 0.12% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
shtab/main.py main 8 ⭐ 148 😞 7 🙂 61.90% 🙂 Try splitting into smaller methods
shtab/main.py get_main_parser 0 ⭐ 126 😞 3 ⭐ 82.58% ⭐ Try splitting into smaller methods

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!

Freed-Wu commented 1 year ago

Any other problem?

Freed-Wu commented 1 year ago

@casperdcl ?

casperdcl commented 1 year ago

Apologies for the delay; thanks for bumping, @Freed-Wu.

Added some tests.

Slightly concerned people may get confused (e.g. an FAQ might be "why does shtab --print-completion=bash mylib.get_parser print shtab's rather than mylib's completions?").

To help combat this, perhaps it's better to rename the option to --print-own-completion?

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (1eb80f6) 91.36% compared to head (40413bb) 91.39%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #114 +/- ## ========================================== + Coverage 91.36% 91.39% +0.02% ========================================== Files 3 3 Lines 336 337 +1 ========================================== + Hits 307 308 +1 Misses 29 29 ``` | [Impacted Files](https://codecov.io/gh/iterative/shtab/pull/114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative) | Coverage Δ | | |---|---|---| | [shtab/main.py](https://codecov.io/gh/iterative/shtab/pull/114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative#diff-c2h0YWIvbWFpbi5weQ==) | `87.50% <100.00%> (+0.32%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Freed-Wu commented 1 year ago

perhaps it's better to rename the option to --print-own-completion?

both are OK :smile: