Skip to content

Comments

tcsh: Fix autocompletion for no single-hyphen args#112

Merged
casperdcl merged 5 commits intoiterative:mainfrom
simaoafonso-pwt:tcsh/fix-singlehyphen
Jun 14, 2023
Merged

tcsh: Fix autocompletion for no single-hyphen args#112
casperdcl merged 5 commits intoiterative:mainfrom
simaoafonso-pwt:tcsh/fix-singlehyphen

Conversation

@simaoafonso-pwt
Copy link
Contributor

If the parser has no single-hyphen options, the tcsh template would
generate a syntax error.

Include a hack to that the autocompletion for the double-hyphen
selection does not add an extra space at the end.


Another fix to the tcsh template support, see #56 #57 #58

@sourcery-ai

This comment was marked as off-topic.

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2022

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.66%. Comparing base (25fc707) to head (3df3b2c).
⚠️ Report is 90 commits behind head on main.

Files with missing lines Patch % Lines
shtab/__init__.py 44.44% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   89.62%   88.66%   -0.96%     
==========================================
  Files           3        3              
  Lines         347      353       +6     
==========================================
+ Hits          311      313       +2     
- Misses         36       40       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@casperdcl casperdcl self-requested a review October 28, 2022 23:10
@casperdcl casperdcl added shell-tcsh good-first-issue Good for newcomers (good-first-issue) external-request You asked, we did labels Oct 28, 2022
Copy link
Collaborator

@casperdcl casperdcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to break things a little (at least on bash).

before:

main$ eval "$(PYTHONPATH=. python examples/customcomplete.py completion bash)"
main$ customcomplete <TAB>
completion  process

after:

fix-singlehyphen$ eval "$(PYTHONPATH=. python examples/customcomplete.py completion bash)"
fix-singlehyphen$ customcomplete <TAB>
fix-singlehyphen$ customcomplete completion <TAB>
fix-singlehyphen$ customcomplete completion bash

@simaoafonso-pwt
Copy link
Contributor Author

This seems to break things a little (at least on bash).

That's weird, I only changed the csh function, and this commit to avoid test failures.

b05c0c7

I should rebase and retest this.

@simaoafonso-pwt simaoafonso-pwt force-pushed the tcsh/fix-singlehyphen branch from be2eed3 to 5f678ec Compare June 14, 2023 14:47
@simaoafonso-pwt
Copy link
Contributor Author

Rebased and re-tested, including that test you mentioned, works for me.

@simaoafonso-pwt
Copy link
Contributor Author

Rebased and re-tested, including that test you mentioned, works for me.

Sounds like the test failure is not my fault, pydoc-markdown cannot run correctly on PyPy?

@casperdcl casperdcl force-pushed the tcsh/fix-singlehyphen branch from 336c7ad to d73a29e Compare June 14, 2023 16:11
@casperdcl
Copy link
Collaborator

Thanks! Rebased now over #139 (should merge that first). Better now?

@simaoafonso-pwt
Copy link
Contributor Author

LGTM, you can merge this.

If the parser has no single-hyphen options, the tcsh template would
generate a syntax error.

Include a hack to that the autocompletion for the double-hyphen
selection does not add an extra space at the end.
- Document "root_prefix" non-usage
- Use raw strings if possible
- Sort options (cosmetic)
@casperdcl casperdcl force-pushed the tcsh/fix-singlehyphen branch from d73a29e to 5a8d3ea Compare June 14, 2023 16:35
@casperdcl casperdcl force-pushed the tcsh/fix-singlehyphen branch from 5a8d3ea to ce9ea94 Compare June 14, 2023 16:39
@casperdcl casperdcl force-pushed the tcsh/fix-singlehyphen branch from ce9ea94 to 3df3b2c Compare June 14, 2023 16:41
Copy link
Collaborator

@casperdcl casperdcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; thanks!

I removed the examples/doublecomplete.py since it seems more about debugging/testing.

Maybe worth adding a follow-up test (in tests/test_shtab.py) instead.

@casperdcl casperdcl merged commit d3721cf into iterative:main Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-request You asked, we did good-first-issue Good for newcomers (good-first-issue) shell-tcsh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants