Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force coloured output unless explicitly disabled #1125

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading