MarketSquare / MarketSquare/robotframework-tidy

Option to output in colour when piped

Open
#447 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
RobotFramework
Stars
113
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Currently, when the output is piped (whether to an application or file), it seems as though `--color` is ignored. We have a script running in CI that runs robotidy, and captures the output. It would be nice if we could get it to work in colour.

For example, this is in colour:
```
robotidy --check --diff --color .
```

But this is not (replace `type` with `cat` if not using windows):
```
robotidy --check --diff --color . > output.txt
type output.txt
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how `robotidy --check --diff --color .` decides whether output is being written to a terminal or redirected. Compare terminal output with the `output.txt` example; done means `--color` preserves colour when output is piped or captured, including the CI use case.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.