Return True when output should be JSON. Checks per-command --json flag first, then UNITY_CLI_JSON env via context.
(context: CLIContext, json_flag: bool)
| 55 | |
| 56 | |
| 57 | def _should_json(context: CLIContext, json_flag: bool) -> bool: |
| 58 | """Return True when output should be JSON. |
| 59 | |
| 60 | Checks per-command --json flag first, then UNITY_CLI_JSON env via context. |
| 61 | """ |
| 62 | if json_flag: |
| 63 | configure_output(OutputMode.JSON) |
| 64 | return True |
| 65 | return context.output.is_json # UNITY_CLI_JSON env |
| 66 | |
| 67 | |
| 68 | # ============================================================================= |