Skip to content

Add ability to write completions to the file #192

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arcan1s
Copy link

@arcan1s arcan1s commented Jun 18, 2025

It might be useful to write file directly instead of forwarding output to it, e.g. if files are generated automatically in pipeline (via tox or whatever is used) and distributed together with an application. No append option supported.

This commit also updates docs for cases when it is possible to write file directly and no sudo required to write there

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.

Thanks!

@casperdcl casperdcl added external-request You asked, we did documentation Markdown files enhancement New feature or request good-first-issue Good for newcomers (good-first-issue) p2-nice-to-have Low priority labels Jun 18, 2025
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.91%. Comparing base (1d7a36b) to head (6cac14c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #192      +/-   ##
==========================================
+ Coverage   88.88%   88.91%   +0.03%     
==========================================
  Files           3        3              
  Lines         360      361       +1     
==========================================
+ Hits          320      321       +1     
  Misses         40       40              

☔ 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
Copy link
Collaborator

Apparently this will be deprecated python/cpython#58032 - might prefer a different implementation.

@arcan1s
Copy link
Author

arcan1s commented Jun 27, 2025

oof, tbh I don't think in context of this tools we would even actually be affected by the mentioned issues, but nevertheless (because of deprecation) I've replaced logic to (optional) Path argument and handle it accordingly (i.e. if empty, then emit sys.stdout and file descriptor otherwise). I've also added few tests to cover new code

Please, let me know if you would like to see another solution here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Markdown files enhancement New feature or request external-request You asked, we did good-first-issue Good for newcomers (good-first-issue) p2-nice-to-have Low priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants