Skip to content

Commit fced8dc

Browse files
committed
fix: resolve lint errors — gofmt, paramTypeCombine, octalLiteral
1 parent e215d7e commit fced8dc

18 files changed

Lines changed: 1740 additions & 116 deletions

AUDIT.md

Lines changed: 1564 additions & 0 deletions
Large diffs are not rendered by default.

cmd/member.go

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,22 +174,28 @@ var guestInviteCmd = &cobra.Command{
174174
}
175175
req := &api.InviteGuestRequest{Email: email}
176176
if cmd.Flags().Changed("can-edit-tags") {
177-
v, _ := cmd.Flags().GetBool("can-edit-tags"); req.CanEditTags = &v
177+
v, _ := cmd.Flags().GetBool("can-edit-tags")
178+
req.CanEditTags = &v
178179
}
179180
if cmd.Flags().Changed("can-see-time-spent") {
180-
v, _ := cmd.Flags().GetBool("can-see-time-spent"); req.CanSeeTimeSpent = &v
181+
v, _ := cmd.Flags().GetBool("can-see-time-spent")
182+
req.CanSeeTimeSpent = &v
181183
}
182184
if cmd.Flags().Changed("can-see-time-estimated") {
183-
v, _ := cmd.Flags().GetBool("can-see-time-estimated"); req.CanSeeTimeEstimated = &v
185+
v, _ := cmd.Flags().GetBool("can-see-time-estimated")
186+
req.CanSeeTimeEstimated = &v
184187
}
185188
if cmd.Flags().Changed("can-create-views") {
186-
v, _ := cmd.Flags().GetBool("can-create-views"); req.CanCreateViews = &v
189+
v, _ := cmd.Flags().GetBool("can-create-views")
190+
req.CanCreateViews = &v
187191
}
188192
if cmd.Flags().Changed("can-see-points-estimated") {
189-
v, _ := cmd.Flags().GetBool("can-see-points-estimated"); req.CanSeePointsEstimated = &v
193+
v, _ := cmd.Flags().GetBool("can-see-points-estimated")
194+
req.CanSeePointsEstimated = &v
190195
}
191196
if cmd.Flags().Changed("custom-role-id") {
192-
v, _ := cmd.Flags().GetInt("custom-role-id"); req.CustomRoleID = &v
197+
v, _ := cmd.Flags().GetInt("custom-role-id")
198+
req.CustomRoleID = &v
193199
}
194200
if err := client.InviteGuest(ctx, wid, req); err != nil {
195201
return handleError(err)
@@ -254,22 +260,28 @@ var guestEditCmd = &cobra.Command{
254260
}
255261
req := &api.EditGuestRequest{}
256262
if cmd.Flags().Changed("can-edit-tags") {
257-
v, _ := cmd.Flags().GetBool("can-edit-tags"); req.CanEditTags = &v
263+
v, _ := cmd.Flags().GetBool("can-edit-tags")
264+
req.CanEditTags = &v
258265
}
259266
if cmd.Flags().Changed("can-see-time-spent") {
260-
v, _ := cmd.Flags().GetBool("can-see-time-spent"); req.CanSeeTimeSpent = &v
267+
v, _ := cmd.Flags().GetBool("can-see-time-spent")
268+
req.CanSeeTimeSpent = &v
261269
}
262270
if cmd.Flags().Changed("can-see-time-estimated") {
263-
v, _ := cmd.Flags().GetBool("can-see-time-estimated"); req.CanSeeTimeEstimated = &v
271+
v, _ := cmd.Flags().GetBool("can-see-time-estimated")
272+
req.CanSeeTimeEstimated = &v
264273
}
265274
if cmd.Flags().Changed("can-create-views") {
266-
v, _ := cmd.Flags().GetBool("can-create-views"); req.CanCreateViews = &v
275+
v, _ := cmd.Flags().GetBool("can-create-views")
276+
req.CanCreateViews = &v
267277
}
268278
if cmd.Flags().Changed("can-see-points-estimated") {
269-
v, _ := cmd.Flags().GetBool("can-see-points-estimated"); req.CanSeePointsEstimated = &v
279+
v, _ := cmd.Flags().GetBool("can-see-points-estimated")
280+
req.CanSeePointsEstimated = &v
270281
}
271282
if cmd.Flags().Changed("custom-role-id") {
272-
v, _ := cmd.Flags().GetInt("custom-role-id"); req.CustomRoleID = &v
283+
v, _ := cmd.Flags().GetInt("custom-role-id")
284+
req.CustomRoleID = &v
273285
}
274286
resp, err := client.EditGuest(ctx, wid, id, req)
275287
if err != nil {

internal/api/attachments.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ func (c *Client) CreateTaskAttachment(ctx context.Context, taskID, filePath stri
4242
writer.Close()
4343

4444
var o *TaskScopedOptions
45-
if len(opts) > 0 { o = opts[0] }
45+
if len(opts) > 0 {
46+
o = opts[0]
47+
}
4648
url := c.BaseURL + fmt.Sprintf("/v2/task/%s/attachment", taskID) + taskScopedQuery(o)
4749
req, err := http.NewRequestWithContext(ctx, "POST", url, &buf)
4850
if err != nil {

internal/api/attachments_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestCreateTaskAttachment(t *testing.T) {
3030

3131
tmpDir := t.TempDir()
3232
tmpFile := filepath.Join(tmpDir, "test.txt")
33-
if err := os.WriteFile(tmpFile, []byte("hello"), 0644); err != nil {
33+
if err := os.WriteFile(tmpFile, []byte("hello"), 0o644); err != nil {
3434
t.Fatal(err)
3535
}
3636

internal/api/checklists.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ type EditChecklistItemRequest struct {
5656

5757
func (c *Client) CreateChecklist(ctx context.Context, taskID string, req *CreateChecklistRequest, opts ...*TaskScopedOptions) (*ChecklistResponse, error) {
5858
var o *TaskScopedOptions
59-
if len(opts) > 0 { o = opts[0] }
59+
if len(opts) > 0 {
60+
o = opts[0]
61+
}
6062
var resp ChecklistResponse
6163
if err := c.Do(ctx, "POST", fmt.Sprintf("/v2/task/%s/checklist", taskID)+taskScopedQuery(o), req, &resp); err != nil {
6264
return nil, err

internal/api/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ type ClientInterface interface {
6060
SearchTasks(ctx context.Context, teamID string, opts *SearchTasksOptions) (*TasksResponse, error)
6161

6262
// Comments
63-
ListComments(ctx context.Context, taskID string, startID string, opts ...*TaskScopedOptions) (*CommentsResponse, error)
64-
ListListComments(ctx context.Context, listID string, startID string) (*CommentsResponse, error)
63+
ListComments(ctx context.Context, taskID, startID string, opts ...*TaskScopedOptions) (*CommentsResponse, error)
64+
ListListComments(ctx context.Context, listID, startID string) (*CommentsResponse, error)
6565
CreateComment(ctx context.Context, taskID string, req *CreateCommentRequest, opts ...*TaskScopedOptions) (*CreateCommentResponse, error)
6666
CreateListComment(ctx context.Context, listID string, req *CreateCommentRequest) (*CreateCommentResponse, error)
6767
UpdateComment(ctx context.Context, commentID string, req *UpdateCommentRequest) error
@@ -116,7 +116,7 @@ type ClientInterface interface {
116116
ChangeTagNames(ctx context.Context, teamID string, req *ChangeTagNameRequest) error
117117

118118
// Time Tracking Legacy (task-level)
119-
GetLegacyTrackedTime(ctx context.Context, taskID string, subcategoryID string, opts ...*TaskScopedOptions) (*LegacyTimeResponse, error)
119+
GetLegacyTrackedTime(ctx context.Context, taskID, subcategoryID string, opts ...*TaskScopedOptions) (*LegacyTimeResponse, error)
120120
TrackLegacyTime(ctx context.Context, taskID string, req *LegacyTrackTimeRequest, opts ...*TaskScopedOptions) (*LegacyTimeResponse, error)
121121
EditLegacyTime(ctx context.Context, taskID, intervalID string, req *LegacyEditTimeRequest, opts ...*TaskScopedOptions) error
122122
DeleteLegacyTime(ctx context.Context, taskID, intervalID string, opts ...*TaskScopedOptions) error
@@ -207,7 +207,7 @@ type ClientInterface interface {
207207
CreateThreadedComment(ctx context.Context, commentID string, req *CreateCommentRequest) (*CreateCommentResponse, error)
208208

209209
// View Comments
210-
ListViewComments(ctx context.Context, viewID string, startID string) (*CommentsResponse, error)
210+
ListViewComments(ctx context.Context, viewID, startID string) (*CommentsResponse, error)
211211
CreateViewComment(ctx context.Context, viewID string, req *CreateCommentRequest) (*CreateCommentResponse, error)
212212

213213
// Guest Assignments

internal/api/comments.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type CommentsResponse struct {
2222
Comments []Comment `json:"comments"`
2323
}
2424

25-
func (c *Client) ListComments(ctx context.Context, taskID string, startID string, opts ...*TaskScopedOptions) (*CommentsResponse, error) {
25+
func (c *Client) ListComments(ctx context.Context, taskID, startID string, opts ...*TaskScopedOptions) (*CommentsResponse, error) {
2626
params := url.Values{}
2727
if startID != "" {
2828
params.Set("start_id", startID)
@@ -46,7 +46,7 @@ func (c *Client) ListComments(ctx context.Context, taskID string, startID string
4646
return &resp, nil
4747
}
4848

49-
func (c *Client) ListListComments(ctx context.Context, listID string, startID string) (*CommentsResponse, error) {
49+
func (c *Client) ListListComments(ctx context.Context, listID, startID string) (*CommentsResponse, error) {
5050
path := fmt.Sprintf("/v2/list/%s/comment", listID)
5151
if startID != "" {
5252
path += "?start_id=" + startID
@@ -73,7 +73,9 @@ type CreateCommentResponse struct {
7373

7474
func (c *Client) CreateComment(ctx context.Context, taskID string, req *CreateCommentRequest, opts ...*TaskScopedOptions) (*CreateCommentResponse, error) {
7575
var o *TaskScopedOptions
76-
if len(opts) > 0 { o = opts[0] }
76+
if len(opts) > 0 {
77+
o = opts[0]
78+
}
7779
var resp CreateCommentResponse
7880
if err := c.Do(ctx, "POST", fmt.Sprintf("/v2/task/%s/comment", taskID)+taskScopedQuery(o), req, &resp); err != nil {
7981
return nil, err
@@ -124,7 +126,7 @@ func (c *Client) CreateThreadedComment(ctx context.Context, commentID string, re
124126

125127
// Chat View Comments
126128

127-
func (c *Client) ListViewComments(ctx context.Context, viewID string, startID string) (*CommentsResponse, error) {
129+
func (c *Client) ListViewComments(ctx context.Context, viewID, startID string) (*CommentsResponse, error) {
128130
path := fmt.Sprintf("/v2/view/%s/comment", viewID)
129131
if startID != "" {
130132
path += "?start_id=" + startID

internal/api/custom_fields.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ func (c *Client) GetWorkspaceCustomFields(ctx context.Context, teamID string) (*
4949

5050
func (c *Client) SetCustomFieldValue(ctx context.Context, taskID, fieldID string, req *SetCustomFieldRequest, opts ...*TaskScopedOptions) error {
5151
var o *TaskScopedOptions
52-
if len(opts) > 0 { o = opts[0] }
52+
if len(opts) > 0 {
53+
o = opts[0]
54+
}
5355
return c.Do(ctx, "POST", fmt.Sprintf("/v2/task/%s/field/%s", taskID, fieldID)+taskScopedQuery(o), req, nil)
5456
}
5557

5658
func (c *Client) RemoveCustomFieldValue(ctx context.Context, taskID, fieldID string, opts ...*TaskScopedOptions) error {
5759
var o *TaskScopedOptions
58-
if len(opts) > 0 { o = opts[0] }
60+
if len(opts) > 0 {
61+
o = opts[0]
62+
}
5963
return c.Do(ctx, "DELETE", fmt.Sprintf("/v2/task/%s/field/%s", taskID, fieldID)+taskScopedQuery(o), nil, nil)
6064
}

internal/api/custom_task_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
)
77

88
type CustomTaskType struct {
9-
ID int `json:"id"`
10-
Name string `json:"name"`
11-
Description string `json:"description,omitempty"`
9+
ID int `json:"id"`
10+
Name string `json:"name"`
11+
Description string `json:"description,omitempty"`
1212
Avatar interface{} `json:"avatar,omitempty"`
1313
}
1414

internal/api/goals.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ func (c *Client) CreateKeyResult(ctx context.Context, goalID string, req *Create
132132
}
133133

134134
type UpdateKeyResultRequest struct {
135-
StepsCurrent *int `json:"steps_current,omitempty"`
136-
Note string `json:"note,omitempty"`
135+
StepsCurrent *int `json:"steps_current,omitempty"`
136+
Note string `json:"note,omitempty"`
137137
}
138138

139139
func (c *Client) UpdateKeyResult(ctx context.Context, keyResultID string, req *UpdateKeyResultRequest) (*KeyResultResponse, error) {

0 commit comments

Comments
 (0)