ward
ward copied to clipboard
Colour output when running on CI platforms that support it
GitHub Actions supports colour terminal output, but Rich disables it when it detects it's not writing to a terminal.
We should check environment variables, and if we're on a CI platform that we know supports colours, force Rich to write them as described here: https://github.com/willmcgugan/rich/issues/52#issuecomment-624521401
We can detect that we're running on GitHub Actions by looking at the env var described in here: https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
We should also allow the user to force colour output by passing a command line flag.
Example of output in our CI pipeline just now:

Hi @darrenburns, I can work on this issue if no one else has. I'm comfortable with Python and have used ward before, but haven't contributed much to open source projects, so I thought I would try to help with this.