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

fix: Improve custom commands formatters and add outputs #3228

Open
wants to merge 5 commits into
base: release/2.0
Choose a base branch
from

Conversation

danimtb
Copy link
Member

@danimtb danimtb commented May 23, 2023

Some additional info I found missing while I was developing custom commands for the build info

@CLAassistant
Copy link

CLAassistant commented May 23, 2023

CLA assistant check
All committers have signed the CLA.

Comment on lines +71 to +72
def output_text(msg):
ConanOutput().info(msg)
Copy link
Member

Choose a reason for hiding this comment

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

output text shouldn't use ConanOutput(), that goes to sys.stderr, it should probably use cli_out_write() too

Copy link
Member Author

Choose a reason for hiding this comment

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

but ConanOutput() is kind of "non-parseable" user output right? Why should it use cli_out_write()? This is what was confusing to me and what I'd like to clarify with this PR

Copy link
Member

Choose a reason for hiding this comment

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

If it is a "formatter", it is intended for some kind of "final message" result. Even if in the text format is not machine readable, it should go to stdout, not to stderr, because it is the output of the command.

If that is not the case, and it is just informational message, it can be put in the command itself, and not in the formatter.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated!

Copy link
Member

Choose a reason for hiding this comment

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

I still see the ConanOutput().info() and not cli_out_write(), did you forget to push changes?

reference/extensions/custom_commands.rst Outdated Show resolved Hide resolved
Comment on lines +71 to +72
def output_text(msg):
ConanOutput().info(msg)
Copy link
Member

Choose a reason for hiding this comment

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

I still see the ConanOutput().info() and not cli_out_write(), did you forget to push changes?

reference/extensions/custom_commands.rst Outdated Show resolved Hide resolved
Co-authored-by: James <memsharded@gmail.com>
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.

None yet

4 participants