Skip to content

Commit

Permalink
Bump github.com/fatih/color from 1.15.0 to 1.16.0 (#2657)
Browse files Browse the repository at this point in the history
* Bump github.com/fatih/color from 1.15.0 to 1.16.0

Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](fatih/color@v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/fatih/color
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix ansi escape codes for color tests

- github.com/fatih/color changed escape codes in 1.16

Co-authored-by: Alex Rocha <[email protected]>
Co-authored-by: M. Oleske <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: M. Oleske <[email protected]>
Co-authored-by: Alex Rocha <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2023
1 parent a2b0cf9 commit cd71c30
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 34 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/cloudfoundry/bosh-cli v6.4.1+incompatible
github.com/cyphar/filepath-securejoin v0.2.4
github.com/docker/distribution v2.8.3+incompatible
github.com/fatih/color v1.15.0
github.com/fatih/color v1.16.0
github.com/google/go-querystring v1.1.0
github.com/jessevdk/go-flags v1.5.0
github.com/kr/pty v1.1.8
Expand Down Expand Up @@ -67,7 +67,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nxadm/tail v1.4.8 // indirect
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4Kfc
github.com/drewolson/testflight v1.0.0/go.mod h1:t9oKuuEohRGLb80SWX+uxJHuhX98B7HnojqtW+Ryq30=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
Expand Down Expand Up @@ -165,8 +165,8 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
Expand Down Expand Up @@ -323,6 +323,7 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
6 changes: 3 additions & 3 deletions util/ui/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ var _ = Describe("Table", func() {
{"#0", "data1", "data2", "data3"},
},
2)
Expect(out).To(Say(" \x1b\\[1mheader1\x1b\\[0m")) // Makes sure empty values are not bolded
Expect(out).To(Say("\x1b\\[1mheader2\x1b\\[0m"))
Expect(out).To(Say("\x1b\\[1mheader3\x1b\\[0m"))
Expect(out).To(Say(" \u001B\\[1mheader1\u001B\\[22m")) // Makes sure empty values are not bolded
Expect(out).To(Say("\u001B\\[1mheader2\u001B\\[22m"))
Expect(out).To(Say("\u001B\\[1mheader3\u001B\\[22m"))
Expect(out).To(Say("#0 data1 data2 data3"))
})
})
Expand Down
20 changes: 10 additions & 10 deletions util/ui/ui_for_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ var _ = Describe("UI", func() {
{"#2", "crashed", "val1", "val2"},
})

Expect(ui.Out).To(Say("\x1b\\[1mheader1\x1b\\[0m\\s+\x1b\\[1mheader2\x1b\\[0m\\s+\x1b\\[1mheader3\x1b\\[0m")) // Makes sure empty values are not bolded
Expect(ui.Out).To(Say("\u001B\\[1mheader1\u001B\\[22m\\s+\u001B\\[1mheader2\u001B\\[22m\\s+\u001B\\[1mheader3\u001B\\[22m")) // Makes sure empty values are not bolded
Expect(ui.Out).To(Say(`#0\s+starting\s+val1\s+val2`))
Expect(ui.Out).To(Say("#1\\s+\x1b\\[31;1mdown\x1b\\[0m\\s+val1\\s+val2"))
Expect(ui.Out).To(Say("#2\\s+\x1b\\[31;1mcrashed\x1b\\[0m\\s+val1\\s+val2"))
Expect(ui.Out).To(Say("#1\\s+\u001B\\[31;1mdown\u001B\\[0;22m\\s+val1\\s+val2"))
Expect(ui.Out).To(Say("#2\\s+\u001B\\[31;1mcrashed\u001B\\[0;22m\\s+val1\\s+val2"))
})
})

Expand All @@ -65,10 +65,10 @@ var _ = Describe("UI", func() {
{"#2", ui.TranslateText("crashed"), "val1", "val2"},
})

Expect(ui.Out).To(Say("\x1b\\[1mheader1\x1b\\[0m\\s+\x1b\\[1mheader2\x1b\\[0m\\s+\x1b\\[1mheader3\x1b\\[0m")) // Makes sure empty values are not bolded
Expect(ui.Out).To(Say("\u001B\\[1mheader1\u001B\\[22m\\s+\u001B\\[1mheader2\u001B\\[22m\\s+\u001B\\[1mheader3\u001B\\[22m")) // Makes sure empty values are not bolded
Expect(ui.Out).To(Say(`#0\s+%s\s+val1\s+val2`, ui.TranslateText("starting")))
Expect(ui.Out).To(Say("#1\\s+\x1b\\[31;1m%s\x1b\\[0m\\s+val1\\s+val2", ui.TranslateText("down")))
Expect(ui.Out).To(Say("#2\\s+\x1b\\[31;1m%s\x1b\\[0m\\s+val1\\s+val2", ui.TranslateText("crashed")))
Expect(ui.Out).To(Say("#1\\s+\u001B\\[31;1m%s\u001B\\[0;22m\\s+val1\\s+val2", ui.TranslateText("down")))
Expect(ui.Out).To(Say("#2\\s+\u001B\\[31;1m%s\u001B\\[0;22m\\s+val1\\s+val2", ui.TranslateText("crashed")))
})
})
})
Expand Down Expand Up @@ -144,8 +144,8 @@ var _ = Describe("UI", func() {

It("displays a table with requested state and instances in red", func() {
Expect(ui.Out).To(Say("name: dora\n"))
Expect(ui.Out).To(Say("requested state: \x1b\\[31;1mrunning\x1b\\[0m\n"))
Expect(ui.Out).To(Say("instances: \x1b\\[31;1m0/1\x1b\\[0m\n"))
Expect(ui.Out).To(Say("requested state: \u001B\\[31;1mrunning\u001B\\[0;22m\n"))
Expect(ui.Out).To(Say("instances: \u001B\\[31;1m0/1\u001B\\[0;22m\n"))
})
})

Expand All @@ -168,8 +168,8 @@ var _ = Describe("UI", func() {

It("displays a table with requested state and instances in red", func() {
Expect(ui.Out).To(Say("name: dora\n"))
Expect(ui.Out).To(Say("requested state: \x1b\\[31;1m%s\x1b\\[0m\n", ui.TranslateText("running")))
Expect(ui.Out).To(Say("instances: \x1b\\[31;1m0/1\x1b\\[0m\n"))
Expect(ui.Out).To(Say("requested state: \u001B\\[31;1m%s\u001B\\[0;22m\n", ui.TranslateText("running")))
Expect(ui.Out).To(Say("instances: \u001B\\[31;1m0/1\u001B\\[0;22m\n"))
})
})
})
Expand Down
30 changes: 15 additions & 15 deletions util/ui/ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var _ = Describe("UI", func() {

It("displays the error to ui.Err and displays FAILED in bold red to ui.Out", func() {
Expect(ui.Err).To(Say("I am an error\n"))
Expect(out).To(Say("\x1b\\[31;1mFAILED\x1b\\[0m\n"))
Expect(out).To(Say("\u001B\\[31;1mFAILED\u001B\\[0;22m\n"))
})

When("the locale is not set to english", func() {
Expand All @@ -110,15 +110,15 @@ var _ = Describe("UI", func() {
It("displays the error text to ui.Err and displays FAILED in bold red to ui.Out", func() {
ui.DisplayError(errors.New("I am a BANANA!"))
Expect(ui.Err).To(Say("I am a BANANA!\n"))
Expect(out).To(Say("\x1b\\[31;1mFAILED\x1b\\[0m\n"))
Expect(out).To(Say("\u001B\\[31;1mFAILED\u001B\\[0;22m\n"))
})
})
})

Describe("DisplayHeader", func() {
It("displays the header colorized and bolded to ui.Out", func() {
ui.DisplayHeader("some-header")
Expect(out).To(Say("\x1b\\[1msome-header\x1b\\[0m"))
Expect(out).To(Say("\u001B\\[1msome-header\u001B\\[22m"))
})

When("the locale is not set to English", func() {
Expand All @@ -134,7 +134,7 @@ var _ = Describe("UI", func() {

It("displays the translated header colorized and bolded to ui.Out", func() {
ui.DisplayHeader("FEATURE FLAGS")
Expect(out).To(Say("\x1b\\[1mINDICATEURS DE FONCTION\x1b\\[0m"))
Expect(out).To(Say("\u001B\\[1mINDICATEURS DE FONCTION\u001B\\[22m"))
})
})
})
Expand All @@ -149,7 +149,7 @@ var _ = Describe("UI", func() {
Describe("DisplayOK", func() {
It("displays 'OK' in green and bold", func() {
ui.DisplayOK()
Expect(out).To(Say("\x1b\\[32;1mOK\x1b\\[0m"))
Expect(out).To(Say("\u001B\\[32;1mOK\u001B\\[0;22m"))
})
})

Expand Down Expand Up @@ -269,7 +269,7 @@ var _ = Describe("UI", func() {
map[string]interface{}{
"SomeMapValue": "map-value",
})
Expect(out).To(Say("template with \x1b\\[1mmap-value\x1b\\[0m"))
Expect(out).To(Say("template with \u001B\\[1mmap-value\u001B\\[22m"))
})
})

Expand All @@ -283,7 +283,7 @@ var _ = Describe("UI", func() {
map[string]interface{}{
"SomeOtherMapValue": "other-map-value",
})
Expect(out).To(Say("template with \x1b\\[1mmap-value\x1b\\[0m and <no value>"))
Expect(out).To(Say("template with \u001B\\[1mmap-value\u001B\\[22m and <no value>"))
})
})

Expand All @@ -304,7 +304,7 @@ var _ = Describe("UI", func() {
map[string]interface{}{
"AppName": "some-app-name",
})
Expect(out).To(Say("L'application \x1b\\[1msome-app-name\x1b\\[0m n'existe pas.\n"))
Expect(out).To(Say("L'application \u001B\\[1msome-app-name\u001B\\[22m n'existe pas.\n"))
})
})
})
Expand All @@ -322,7 +322,7 @@ var _ = Describe("UI", func() {
map[string]interface{}{
"SomeMapValue": "map-value",
})
Expect(out).To(Say("template with \x1b\\[36;1mmap-value\x1b\\[0m"))
Expect(out).To(Say("template with \u001B\\[36;1mmap-value\u001B\\[0;22m"))
})
})

Expand All @@ -336,7 +336,7 @@ var _ = Describe("UI", func() {
map[string]interface{}{
"SomeOtherMapValue": "other-map-value",
})
Expect(out).To(Say("template with \x1b\\[36;1mmap-value\x1b\\[0m and <no value>"))
Expect(out).To(Say("template with \u001B\\[36;1mmap-value\u001B\\[0;22m and <no value>"))
})
})

Expand All @@ -357,31 +357,31 @@ var _ = Describe("UI", func() {
map[string]interface{}{
"AppName": "some-app-name",
})
Expect(out).To(Say("L'application \x1b\\[36;1msome-app-name\x1b\\[0m n'existe pas.\n"))
Expect(out).To(Say("L'application \u001B\\[36;1msome-app-name\u001B\\[0;22m n'existe pas.\n"))
})
})
})

Describe("DisplayDiffAddition", func() {
It("displays a green indented line with a +", func() {
ui.DisplayDiffAddition("added", 3, false)
Expect(out).To(Say(`\x1b\[32m\+ added\x1b\[0m`))
Expect(out).To(Say("\u001B\\[32m\\+\\s+added\u001B\\[0m"))
})
It("displays a hyphen when the addHyphen is true", func() {
ui.DisplayDiffAddition("added", 3, true)
Expect(out).To(Say(`\x1b\[32m\+ - added\x1b\[0m`))
Expect(out).To(Say("\u001B\\[32m\\+\\s+\\- added\u001B\\[0m"))
})

})

Describe("DisplayDiffRemoval", func() {
It("displays a red indented line with a -", func() {
ui.DisplayDiffRemoval("removed", 3, false)
Expect(out).To(Say(`\x1b\[31m\- removed\x1b\[0m`))
Expect(out).To(Say("\u001B\\[31m\\-\\s+removed\u001B\\[0m"))
})
It("displays a a hyphen when addHyphen is true", func() {
ui.DisplayDiffRemoval("removed", 3, true)
Expect(out).To(Say(`\x1b\[31m\- - removed\x1b\[0m`))
Expect(out).To(Say("\u001B\\[31m\\-\\s+\\- removed\u001B\\[0m"))
})
})

Expand Down

0 comments on commit cd71c30

Please sign in to comment.