Skip to content

Commit 1915419

Browse files
committed
table header underscores to spaces
1 parent 0d58df9 commit 1915419

21 files changed

+60
-60
lines changed

cli/organizationmembers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (r *RootCmd) assignOrganizationRoles(orgContext *OrganizationContext) *serp
137137

138138
func (r *RootCmd) listOrganizationMembers(orgContext *OrganizationContext) *serpent.Command {
139139
formatter := cliui.NewOutputFormatter(
140-
cliui.TableFormat([]codersdk.OrganizationMemberWithUserData{}, []string{"username", "organization_roles"}),
140+
cliui.TableFormat([]codersdk.OrganizationMemberWithUserData{}, []string{"username", "organization roles"}),
141141
cliui.JSONFormat(),
142142
)
143143

cli/organizationmembers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestListOrganizationMembers(t *testing.T) {
2323
client, user := coderdtest.CreateAnotherUser(t, ownerClient, owner.OrganizationID, rbac.RoleUserAdmin())
2424

2525
ctx := testutil.Context(t, testutil.WaitMedium)
26-
inv, root := clitest.New(t, "organization", "members", "list", "-c", "user_id,username,organization_roles")
26+
inv, root := clitest.New(t, "organization", "members", "list", "-c", "user id,username,organization roles")
2727
clitest.SetupConfig(t, client, root)
2828

2929
buf := new(bytes.Buffer)

cli/organizationroles.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (r *RootCmd) organizationRoles(orgContext *OrganizationContext) *serpent.Co
3636
func (r *RootCmd) showOrganizationRoles(orgContext *OrganizationContext) *serpent.Command {
3737
formatter := cliui.NewOutputFormatter(
3838
cliui.ChangeFormatterData(
39-
cliui.TableFormat([]roleTableRow{}, []string{"name", "display_name", "site_permissions", "organization_permissions", "user_permissions"}),
39+
cliui.TableFormat([]roleTableRow{}, []string{"name", "display name", "site permissions", "organization permissions", "user permissions"}),
4040
func(data any) (any, error) {
4141
inputs, ok := data.([]codersdk.AssignableRoles)
4242
if !ok {
@@ -103,7 +103,7 @@ func (r *RootCmd) showOrganizationRoles(orgContext *OrganizationContext) *serpen
103103
func (r *RootCmd) editOrganizationRole(orgContext *OrganizationContext) *serpent.Command {
104104
formatter := cliui.NewOutputFormatter(
105105
cliui.ChangeFormatterData(
106-
cliui.TableFormat([]roleTableRow{}, []string{"name", "display_name", "site_permissions", "organization_permissions", "user_permissions"}),
106+
cliui.TableFormat([]roleTableRow{}, []string{"name", "display name", "site permissions", "organization permissions", "user permissions"}),
107107
func(data any) (any, error) {
108108
typed, _ := data.(codersdk.Role)
109109
return []roleTableRow{roleToTableView(typed)}, nil
@@ -387,10 +387,10 @@ func roleToTableView(role codersdk.Role) roleTableRow {
387387

388388
type roleTableRow struct {
389389
Name string `table:"name,default_sort"`
390-
DisplayName string `table:"display_name"`
391-
OrganizationID string `table:"organization_id"`
392-
SitePermissions string ` table:"site_permissions"`
390+
DisplayName string `table:"display name"`
391+
OrganizationID string `table:"organization id"`
392+
SitePermissions string ` table:"site permissions"`
393393
// map[<org_id>] -> Permissions
394-
OrganizationPermissions string `table:"organization_permissions"`
395-
UserPermissions string `table:"user_permissions"`
394+
OrganizationPermissions string `table:"organization permissions"`
395+
UserPermissions string `table:"user permissions"`
396396
}

cli/stat.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ func (r *RootCmd) stat() *serpent.Command {
3232
fs = afero.NewReadOnlyFs(afero.NewOsFs())
3333
formatter = cliui.NewOutputFormatter(
3434
cliui.TableFormat([]statsRow{}, []string{
35-
"host_cpu",
36-
"host_memory",
37-
"home_disk",
38-
"container_cpu",
39-
"container_memory",
35+
"host cpu",
36+
"host memory",
37+
"home disk",
38+
"container cpu",
39+
"container memory",
4040
}),
4141
cliui.JSONFormat(),
4242
)
@@ -284,9 +284,9 @@ func (*RootCmd) statDisk(fs afero.Fs) *serpent.Command {
284284
}
285285

286286
type statsRow struct {
287-
HostCPU *clistat.Result `json:"host_cpu" table:"host_cpu,default_sort"`
288-
HostMemory *clistat.Result `json:"host_memory" table:"host_memory"`
289-
Disk *clistat.Result `json:"home_disk" table:"home_disk"`
290-
ContainerCPU *clistat.Result `json:"container_cpu" table:"container_cpu"`
291-
ContainerMemory *clistat.Result `json:"container_memory" table:"container_memory"`
287+
HostCPU *clistat.Result `json:"host_cpu" table:"host cpu,default_sort"`
288+
HostMemory *clistat.Result `json:"host_memory" table:"host memory"`
289+
Disk *clistat.Result `json:"home_disk" table:"home disk"`
290+
ContainerCPU *clistat.Result `json:"container_cpu" table:"container cpu"`
291+
ContainerMemory *clistat.Result `json:"container_memory" table:"container memory"`
292292
}

cli/testdata/coder_stat_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SUBCOMMANDS:
1111
mem Show memory usage, in gigabytes.
1212

1313
OPTIONS:
14-
-c, --column [host cpu|host memory|home disk|container cpu|container memory] (default: host_cpu,host_memory,home_disk,container_cpu,container_memory)
14+
-c, --column [host cpu|host memory|home disk|container cpu|container memory] (default: host cpu,host memory,home disk,container cpu,container memory)
1515
Columns to display in table output.
1616

1717
-o, --output table|json (default: table)

cli/testdata/coder_users_activate_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ USAGE:
1111
$ coder users activate example_user
1212

1313
OPTIONS:
14-
-c, --column [username|email|created_at|status] (default: username,email,created_at,status)
14+
-c, --column [username|email|created at|status] (default: username,email,created at,status)
1515
Specify a column to filter in the table.
1616

1717
———

cli/testdata/coder_users_list_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ USAGE:
66
Aliases: ls
77

88
OPTIONS:
9-
-c, --column [id|username|email|created at|updated at|status] (default: username,email,created_at,status)
9+
-c, --column [id|username|email|created at|updated at|status] (default: username,email,created at,status)
1010
Columns to display in table output.
1111

1212
-o, --output table|json (default: table)

cli/testdata/coder_users_suspend_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ USAGE:
99
$ coder users suspend example_user
1010

1111
OPTIONS:
12-
-c, --column [username|email|created_at|status] (default: username,email,created_at,status)
12+
-c, --column [username|email|created at|status] (default: username,email,created at,status)
1313
Specify a column to filter in the table.
1414

1515
———

cli/userlist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
func (r *RootCmd) userList() *serpent.Command {
1717
formatter := cliui.NewOutputFormatter(
18-
cliui.TableFormat([]codersdk.User{}, []string{"username", "email", "created_at", "status"}),
18+
cliui.TableFormat([]codersdk.User{}, []string{"username", "email", "created at", "status"}),
1919
cliui.JSONFormat(),
2020
)
2121
client := new(codersdk.Client)

cli/userstatus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (r *RootCmd) createUserStatusCommand(sdkStatus codersdk.UserStatus) *serpen
3636
client := new(codersdk.Client)
3737

3838
var columns []string
39-
allColumns := []string{"username", "email", "created_at", "status"}
39+
allColumns := []string{"username", "email", "created at", "status"}
4040
cmd := &serpent.Command{
4141
Use: fmt.Sprintf("%s <username|user_id>", verb),
4242
Short: short,

codersdk/organizations.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ func ProvisionerTypeValid[T ProvisionerType | string](pt T) error {
4242
type MinimalOrganization struct {
4343
ID uuid.UUID `table:"id" json:"id" validate:"required" format:"uuid"`
4444
Name string `table:"name,default_sort" json:"name"`
45-
DisplayName string `table:"display_name" json:"display_name"`
45+
DisplayName string `table:"display name" json:"display_name"`
4646
Icon string `table:"icon" json:"icon"`
4747
}
4848

4949
// Organization is the JSON representation of a Coder organization.
5050
type Organization struct {
5151
MinimalOrganization `table:"m,recursive_inline"`
5252
Description string `table:"description" json:"description"`
53-
CreatedAt time.Time `table:"created_at" json:"created_at" validate:"required" format:"date-time"`
54-
UpdatedAt time.Time `table:"updated_at" json:"updated_at" validate:"required" format:"date-time"`
53+
CreatedAt time.Time `table:"created at" json:"created_at" validate:"required" format:"date-time"`
54+
UpdatedAt time.Time `table:"updated at" json:"updated_at" validate:"required" format:"date-time"`
5555
IsDefault bool `table:"default" json:"is_default" validate:"required"`
5656
}
5757

@@ -67,7 +67,7 @@ type OrganizationMember struct {
6767
OrganizationID uuid.UUID `table:"organization id" json:"organization_id" format:"uuid"`
6868
CreatedAt time.Time `table:"created at" json:"created_at" format:"date-time"`
6969
UpdatedAt time.Time `table:"updated at" json:"updated_at" format:"date-time"`
70-
Roles []SlimRole `table:"organization_roles" json:"roles"`
70+
Roles []SlimRole `table:"organization roles" json:"roles"`
7171
}
7272

7373
type OrganizationMemberWithUserData struct {

codersdk/provisionerdaemons.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione
275275

276276
type ProvisionerKey struct {
277277
ID uuid.UUID `json:"id" table:"-" format:"uuid"`
278-
CreatedAt time.Time `json:"created_at" table:"created_at" format:"date-time"`
279-
OrganizationID uuid.UUID `json:"organization" table:"organization_id" format:"uuid"`
278+
CreatedAt time.Time `json:"created_at" table:"created at" format:"date-time"`
279+
OrganizationID uuid.UUID `json:"organization" table:"organization id" format:"uuid"`
280280
Name string `json:"name" table:"name,default_sort"`
281281
Tags map[string]string `json:"tags" table:"tags"`
282282
// HashedSecret - never include the access token in the API response

codersdk/roles.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,22 @@ type Permission struct {
5353
// Role is a longer form of SlimRole that includes permissions details.
5454
type Role struct {
5555
Name string `json:"name" table:"name,default_sort" validate:"username"`
56-
OrganizationID string `json:"organization_id,omitempty" table:"organization_id" format:"uuid"`
57-
DisplayName string `json:"display_name" table:"display_name"`
58-
SitePermissions []Permission `json:"site_permissions" table:"site_permissions"`
56+
OrganizationID string `json:"organization_id,omitempty" table:"organization id" format:"uuid"`
57+
DisplayName string `json:"display_name" table:"display name"`
58+
SitePermissions []Permission `json:"site_permissions" table:"site permissions"`
5959
// OrganizationPermissions are specific for the organization in the field 'OrganizationID' above.
60-
OrganizationPermissions []Permission `json:"organization_permissions" table:"organization_permissions"`
61-
UserPermissions []Permission `json:"user_permissions" table:"user_permissions"`
60+
OrganizationPermissions []Permission `json:"organization_permissions" table:"organization permissions"`
61+
UserPermissions []Permission `json:"user_permissions" table:"user permissions"`
6262
}
6363

6464
// PatchRoleRequest is used to edit custom roles.
6565
type PatchRoleRequest struct {
6666
Name string `json:"name" table:"name,default_sort" validate:"username"`
67-
DisplayName string `json:"display_name" table:"display_name"`
68-
SitePermissions []Permission `json:"site_permissions" table:"site_permissions"`
67+
DisplayName string `json:"display_name" table:"display name"`
68+
SitePermissions []Permission `json:"site_permissions" table:"site permissions"`
6969
// OrganizationPermissions are specific to the organization the role belongs to.
70-
OrganizationPermissions []Permission `json:"organization_permissions" table:"organization_permissions"`
71-
UserPermissions []Permission `json:"user_permissions" table:"user_permissions"`
70+
OrganizationPermissions []Permission `json:"organization_permissions" table:"organization permissions"`
71+
UserPermissions []Permission `json:"user_permissions" table:"user permissions"`
7272
}
7373

7474
// FullName returns the role name scoped to the organization ID. This is useful if

codersdk/workspaceproxy.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type WorkspaceProxyStatus struct {
3232
Status ProxyHealthStatus `json:"status" table:"status,default_sort"`
3333
// Report provides more information about the health of the workspace proxy.
3434
Report ProxyHealthReport `json:"report,omitempty" table:"report"`
35-
CheckedAt time.Time `json:"checked_at" table:"checked_at" format:"date-time"`
35+
CheckedAt time.Time `json:"checked_at" table:"checked at" format:"date-time"`
3636
}
3737

3838
// ProxyHealthReport is a report of the health of the workspace proxy.
@@ -48,16 +48,16 @@ type ProxyHealthReport struct {
4848
type WorkspaceProxy struct {
4949
// Extends Region with extra information
5050
Region `table:"region,recursive_inline"`
51-
DerpEnabled bool `json:"derp_enabled" table:"derp_enabled"`
52-
DerpOnly bool `json:"derp_only" table:"derp_only"`
51+
DerpEnabled bool `json:"derp_enabled" table:"derp enabled"`
52+
DerpOnly bool `json:"derp_only" table:"derp only"`
5353

5454
// Status is the latest status check of the proxy. This will be empty for deleted
5555
// proxies. This value can be used to determine if a workspace proxy is healthy
5656
// and ready to use.
5757
Status WorkspaceProxyStatus `json:"status,omitempty" table:"proxy,recursive"`
5858

59-
CreatedAt time.Time `json:"created_at" format:"date-time" table:"created_at"`
60-
UpdatedAt time.Time `json:"updated_at" format:"date-time" table:"updated_at"`
59+
CreatedAt time.Time `json:"created_at" format:"date-time" table:"created at"`
60+
UpdatedAt time.Time `json:"updated_at" format:"date-time" table:"updated at"`
6161
Deleted bool `json:"deleted" table:"deleted"`
6262
Version string `json:"version" table:"version"`
6363
}
@@ -187,8 +187,8 @@ type RegionsResponse[R RegionTypes] struct {
187187
type Region struct {
188188
ID uuid.UUID `json:"id" format:"uuid" table:"id"`
189189
Name string `json:"name" table:"name,default_sort"`
190-
DisplayName string `json:"display_name" table:"display_name"`
191-
IconURL string `json:"icon_url" table:"icon_url"`
190+
DisplayName string `json:"display_name" table:"display name"`
191+
IconURL string `json:"icon_url" table:"icon url"`
192192
Healthy bool `json:"healthy" table:"healthy"`
193193

194194
// PathAppURL is the URL to the base path for path apps. Optional
@@ -200,7 +200,7 @@ type Region struct {
200200
// E.g. *.us.example.com
201201
// E.g. *--suffix.au.example.com
202202
// Optional. Does not need to be on the same domain as PathAppURL.
203-
WildcardHostname string `json:"wildcard_hostname" table:"wildcard_hostname"`
203+
WildcardHostname string `json:"wildcard_hostname" table:"wildcard hostname"`
204204
}
205205

206206
func (c *Client) Regions(ctx context.Context) ([]Region, error) {

docs/cli/stat.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/users_activate.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/users_list.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/users_suspend.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enterprise/cli/grouplist.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ type groupTableRow struct {
6969

7070
// For table output:
7171
Name string `json:"-" table:"name,default_sort"`
72-
DisplayName string `json:"-" table:"display_name"`
73-
OrganizationID uuid.UUID `json:"-" table:"organization_id"`
72+
DisplayName string `json:"-" table:"display name"`
73+
OrganizationID uuid.UUID `json:"-" table:"organization id"`
7474
Members []string `json:"-" table:"members"`
75-
AvatarURL string `json:"-" table:"avatar_url"`
75+
AvatarURL string `json:"-" table:"avatar url"`
7676
}
7777

7878
func groupsToRows(groups ...codersdk.Group) []groupTableRow {

enterprise/cli/licenses.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ func (r *RootCmd) licensesList() *serpent.Command {
140140
type tableLicense struct {
141141
ID int32 `table:"id,default_sort"`
142142
UUID uuid.UUID `table:"uuid" format:"uuid"`
143-
UploadedAt time.Time `table:"uploaded_at" format:"date-time"`
143+
UploadedAt time.Time `table:"uploaded at" format:"date-time"`
144144
// Features is the formatted string for the license claims.
145145
// Used for the table view.
146146
Features string `table:"features"`
147-
ExpiresAt time.Time `table:"expires_at" format:"date-time"`
147+
ExpiresAt time.Time `table:"expires at" format:"date-time"`
148148
Trial bool `table:"trial"`
149149
}
150150

enterprise/cli/organizationmembers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func TestEnterpriseListOrganizationMembers(t *testing.T) {
111111
OrganizationID: owner.OrganizationID,
112112
}, rbac.ScopedRoleOrgAdmin(owner.OrganizationID))
113113

114-
inv, root := clitest.New(t, "organization", "members", "list", "-c", "user_id,username,organization_roles")
114+
inv, root := clitest.New(t, "organization", "members", "list", "-c", "user id,username,organization roles")
115115
clitest.SetupConfig(t, client, root)
116116

117117
buf := new(bytes.Buffer)

0 commit comments

Comments
 (0)