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
Disable progress #1190
Disable progress #1190
Conversation
I believe it can be automatically disabled in CI environments without introduction of new option, see: https://github.com/watson/is-ci |
Thanks @inikulin but using that would limit this too much, in my opinion. |
Can you elaborate, please? |
@inikulin Sure. I don't think we should force hiding it on CI, nor should it be an option only on CI. I think it should be an option that people can choose if they want to use it. In the same way |
👍 |
@@ -62,6 +62,10 @@ commander.option( | |||
'--no-emoji', | |||
'disable emoji in output', | |||
); | |||
commander.option( | |||
'--disable-progress', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CLI convention is to use no-
for negated flags, so this should be --no-progress
.
I don't see the point of a flag when it can be handled automatically for the user. |
I felt the flexibility the current implementation offers is good. Yarn isn't widely adopted in CI yet, so everyone will be manually running Can change it though if the consensus is we want it to be restricted to CI as well as forced. |
So we'll have:
VS
I'm not against an option. We can keep it, but disable progress on CI by default. That's why I ask you a question in #1190 (comment): are you aware of any scenarios there disabling progress on CI can be harmful? |
Fair enough, seems a number of people like it that way too! I'll make the change to add https://github.com/watson/is-ci and keep the option for non-ci too. |
Seems like console reporter tests require some rework now |
We should just have detection, I'm against having another flag for this. |
There are cases besides CI or whatever automated cases you may think of where users may wish to avoid the cutesy terminal-hack output. I'm not sure I understand the opposition to a CLI option for this. There's a CLI option for avoiding emoji. "Yarn isn't widely adopted in CI yet, so everyone will be manually running yarn" I am currently deploying yarn in a deployment pipeline that is not covered by https://github.com/watson/is-ci. |
Thanks Dave, I'm of the same opinion. Nothing bad about a bit of flexibility. Will take some time over the weekend to take a look at the test failures. 😃 |
I am with the two comments above me. Not all CO is going to be covered by |
If you don't want nice terminal output then don't report that you're a TTY when executing yarn. An explosion of user flags is not desirable. This PR will only be accepted without the CLI flag. |
I can't reconcile the pushback here with #922 from a week ago. There are always going to be situations where "nice" output is undesireable even if it's running in a TTY. In particular I'm thinking about accessibility use cases, where TTY functionality is often useful, but for which animated progress spinners are problematic. But also, alas, purchased tools that capture output using a TTY and don't give you the option. |
Adding CLI switches to customize output isn't uncommon. Examples
Sometimes people want to override how output is displayed irrespective of things the utility can automatically detect. All the fancy output here is great if you like eye candy, but some people just want (or need, as @daveadams pointed out wrt accessibility) to strip that stuff out. |
What should it be then? I vote for config option ala |
Summary
I've added
--disable-progress
as it's useful to be able to turn off progress bars on CI environments (like CircleCI) otherwise while using yarn to install packages you have a lot of unnecessary info cluttering the view:It also disables progress for the spinning progress icons.
Test plan
I've added a test to
console-reporter.js
to ensure the feature works as desired.Let me know what you think, thanks!