fix: match column show attribute character to 'S' (#3191)

* fix: match column show attribute character to 'S'

* fix: recover failing lint
mine
Hyeonmin Park 2025-03-12 01:11:03 +09:00 committed by GitHub
parent 08b8efa617
commit 4a829613a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View File

@ -14,7 +14,7 @@ import (
"k8s.io/kubectl/pkg/cmd/get"
)
var fullRX = regexp.MustCompile(`^([\w\s%\/-]+)\:?([\w\d\S\W]*?)\|?([N|T|W|V|R|L|H]{0,3})$`)
var fullRX = regexp.MustCompile(`^([\w\s%\/-]+)\:?([\w\d\S\W]*?)\|?([N|T|W|S|L|R|H]{0,3})$`)
type colAttr byte
@ -22,7 +22,7 @@ const (
number colAttr = 'N'
age colAttr = 'T'
wide colAttr = 'W'
show colAttr = 'V'
show colAttr = 'S'
alignLeft colAttr = 'L'
alignRight colAttr = 'R'
hide colAttr = 'H'

View File

@ -57,6 +57,18 @@ func TestCustCol_parse(t *testing.T) {
},
},
"plain-show": {
s: "fred|S",
e: colDef{
name: "fred",
idx: -1,
colAttrs: colAttrs{
align: tview.AlignLeft,
show: true,
},
},
},
"age": {
s: "AGE|TR",
e: colDef{
@ -198,7 +210,7 @@ func TestCustCol_parse(t *testing.T) {
},
"toast-no-name": {
s: `:.metadata.name.fred|TW`,
s: ":.metadata.name.fred|TW",
err: errors.New(`invalid column definition ":.metadata.name.fred|TW"`),
},