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

Implement option for custom output destinations in output.Get() #877

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

mbestavros
Copy link
Contributor

@mbestavros mbestavros commented Oct 10, 2023

Currently, output.Get() always defaults to creating a new Outputter object that writes to os.Stdout; however, it's possible that a different output channel is desired.

This PR adds an option to allow a different File object as output when calling Get().

Resolves #879.

Signed-off-by: Mark Bestavros <mbestavr@redhat.com>
@mbestavros mbestavros force-pushed the add-output-file-options branch 2 times, most recently from 58280a3 to ebdbf09 Compare October 11, 2023 11:54
@boranx
Copy link
Member

boranx commented Oct 18, 2023

That won't have an effect on how the cli outputs the result, will it?
as far as I can imagine, that might be useful when conftest is used as a lib
If so, could you open up an issue with the rationale for the change for tracking purposes?

@mbestavros
Copy link
Contributor Author

That won't have an effect on how the cli outputs the result, will it?

@boranx It shouldn't. Just allowing an option to redirect that output somewhere else.

as far as I can imagine, that might be useful when conftest is used as a lib

That's why I proposed it! 😄

If so, could you open up an issue with the rationale for the change for tracking purposes?

Done!

Copy link
Member

@boranx boranx 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 for the contribution

@boranx boranx merged commit ce7592e into open-policy-agent:master Oct 20, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement option for custom output destinations in output.Get()
2 participants