Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jun 14, 2023

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: 66.66% and project coverage change: -0.19 ⚠️

Comparison is base (ed933a6) 91.06% compared to head (336c7ad) 90.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   91.06%   90.88%   -0.19%     
==========================================
  Files           3        3              
  Lines         347      351       +4     
==========================================
+ Hits          316      319       +3     
- Misses         31       32       +1     
Impacted Files Coverage Δ
shtab/__init__.py 93.11% <66.66%> (-0.25%) ⬇️

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

@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