Skip to content

Commit

Permalink
Merge pull request #1125 from cloudflare/issue-1106
Browse files Browse the repository at this point in the history
Force coloured output unless explicitly disabled
  • Loading branch information
prymitive authored Sep 30, 2024
2 parents adb0966 + c5dcd86 commit 2dc2098
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/pint/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"os"

"github.com/fatih/color"

"github.com/cloudflare/pint/internal/log"
)

Expand All @@ -17,6 +19,10 @@ func initLogger(level string, noColor bool) error {
if nc != "" && nc != "0" {
noColor = true
}
// Override fatih/color detection of when to **disable** coloring.
if !noColor {
color.NoColor = false
}

log.Setup(l, noColor)

Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Improved accuracy of the [rule/duplicate](checks/rule/duplicate.md) check.
- Fixed GitHub reporter trying to create pull request comments to unmodified lines - #1120.
- Fixed colored output on some environments - #1106.

## v0.65.1

Expand Down

0 comments on commit 2dc2098

Please sign in to comment.