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

Use prettier colors on the CLI reporter? #975

Closed
JoshuaKGoldberg opened this issue Jul 12, 2018 · 6 comments
Closed

Use prettier colors on the CLI reporter? #975

JoshuaKGoldberg opened this issue Jul 12, 2018 · 6 comments
Labels
hacktoberfest https://hacktoberfest.digitalocean.com/

Comments

@JoshuaKGoldberg
Copy link
Contributor

Summary

https://twitter.com/_nicojs/status/1017154960834945024

Referring to colored output in terminals:

We should use that in #StrykerMutator's clear text console reporter 😎

@nicojs
Copy link
Member

nicojs commented Jul 12, 2018

I was actually referring to the deep linking. It would be awesome if you could click to the exact location where the mutant is located. Pretty colors are nice as well, we already have some colors I think, but as I said in the twitter chat, it might all use a make over 💄. You may work your magic by all means 👍

The code is already prepared to write to file as well (it uses an output stream). Not sure if anyone is waiting for that feature, but if you want, you can add it as well. When writing to file we should remove color codes I guess.

The console report is also pretty verbose, which bothers me a little. It prints several lines per mutant. Not sure if others agree @stryker-mutator/contributors ?

@mthmulders
Copy link
Contributor

Awesome idea. Everyone loves colors ;-).

When writing to file we should remove color codes I guess.

This also applies to CI environments (CircleCI, Travis, Jenkins) as they often cannot handle color codes either.

@nicojs
Copy link
Member

nicojs commented Jul 12, 2018

This also applies to CI environments (CircleCI, Travis, Jenkins) as they often cannot handle color codes either.

Hmm true. It's been bugging me a little. I think the best way to mitigated this is to have a --no-colors option with a defaults to true on build servers (!!(process.getEnv('TRAVIS') || process.getEnv('CIRCLECI'))).

@JoshuaKGoldberg can you handle this scope creeping up your spine 😓 ?

If so, I've got another request: unicode emoji's. I would suggest👽 for survived mutants. For the score itself it could use 😄 / 😕 / 😢 for above healthy / warning / danger mutation score (based on thresholds)

@JoshuaKGoldberg
Copy link
Contributor Author

JoshuaKGoldberg commented Jul 12, 2018

Is there a dedicated emoji for scope creep? 🐍 perhaps? 😅

What is the total feature set discussed here?

💄 Color make over for the CLI if in tty mode?
🔗 Links to original file lines in output?
👽 Emoji decorations in output if in a terminal that supports them?

@nicojs
Copy link
Member

nicojs commented Jul 12, 2018

Is there a dedicated emoji for scope creep?

I think you just coined the emoji: 🐍 it is! 🥇

💄 Color make over for the CLI if in tty mode?

Yes. Well... I'm not sure if tty is the correct check to be making. Non-tty can support colors and emoj.

For example:

const chalk = require('chalk').default;

if (process.stdout.isTTY) {
  console.log(chalk.green('YES TTY. Emoji: 🐍'));
} else {
  console.log(chalk.red('NO TTY. Emoji: 🐍'));
}

In vscode debugger terminal:
image

In conemu:

image

In command prompt:

image

🔗 Links to original file lines in output?
👽 Emoji decorations in output if in a terminal that supports them?

If that is feasible for you :)

@nicojs
Copy link
Member

nicojs commented Jul 14, 2018

There is an issue for emoji support in Windows console: microsoft/terminal#190

It seems that there already is some support. So no need to actively check for support I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

No branches or pull requests

3 participants