mirror of
https://github.com/apple/pkl.git
synced 2026-01-13 15:13:38 +01:00
[PR #571] [CLOSED] Add a --color flag to the CLI and disable colors for Pkl test #625
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/571
Author: @thomaspurchas
Created: 7/7/2024
Status: ❌ Closed
Base:
error-coloring← Head:error-coloring📝 Commits (1)
46907c7Add a --color flag to the CLI and disable colors for Pkl test📊 Changes
8 files changed (+34 additions, -6 deletions)
View changed files
📝
pkl-cli/src/main/kotlin/org/pkl/cli/commands/TestCommand.kt(+1 -1)📝
pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/CliBaseOptions.kt(+1 -0)📝
pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/CliCommand.kt(+17 -0)📝
pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/commands/BaseOptions.kt(+10 -2)📝
pkl-commons-test/src/main/kotlin/org/pkl/commons/test/InputOutputTestEngine.kt(+0 -1)📝
pkl-core/src/test/kotlin/org/pkl/core/LanguageSnippetTestsEngine.kt(+1 -0)📝
pkl-gradle/src/main/java/org/pkl/gradle/task/BasePklTask.java(+2 -1)📝
pkl-gradle/src/main/java/org/pkl/gradle/task/ModulesTask.java(+2 -1)📄 Description
The --colors flag makes it possible to forcefully disable colour output, and also forcefully enable it. We make use of this in the native Pkl test engines by passing --colors=never into the pkl commands, which ensures we get a predictable output.
Additionally the pkl test command also sets --colors=never to ensure that pkl test output isn't accidentially contaminated with ansi escape chars, which will break example based tests.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.