Skip to content

Commit

Permalink
Fix reviewdog and coderabbit
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Jan 30, 2024
1 parent c84dd58 commit 79e274e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ui/s3hub/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type fetchS3Keys struct {
keys []model.S3Key
}

// fetchS3KeysCmd fetches the list of the S3 bucket objects.
// fetchS3KeysCmd creates a command to fetch the keys of objects stored in a specified S3 bucket.
func fetchS3KeysCmd(ctx context.Context, app *di.S3App, bucket model.Bucket) tea.Cmd {
return tea.Cmd(func() tea.Msg {
output, err := app.S3ObjectsLister.ListS3Objects(ctx, &usecase.S3ObjectsListerInput{
Expand Down
13 changes: 3 additions & 10 deletions ui/s3hub/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,21 +367,14 @@ func (m *s3hubListS3ObjectModel) s3ObjectListStrWithCheckbox() string {
startIndex = len(m.s3Keys) - windowHeight
endIndex = len(m.s3Keys)
}
} else {
if len(m.s3Keys) > windowHeight {
endIndex = windowHeight
}
} else if len(m.s3Keys) > windowHeight {
endIndex = windowHeight
}

m.status = s3hubListS3ObjectStatusListed
s := fmt.Sprintf("S3 objects %d/%d (profile=%s)\n\n", m.choice.Choice+1, len(m.s3Keys), m.awsProfile.String())
for i := startIndex; i < endIndex; i++ {
s += fmt.Sprintf("%s\n",
ui.Checkbox(
fmt.Sprintf(
"%s",
color.GreenString("%s", m.bucket.Join(m.s3Keys[i]))),
m.choice.Choice == i))
s += fmt.Sprintf("%s\n", ui.Checkbox(color.GreenString("%s", m.bucket.Join(m.s3Keys[i])), m.choice.Choice == i))
}
s += ui.Subtle("\n<esc>: return | <Ctrl-C>: quit | up/down: select\n")
s += ui.Subtle("<enter>, <space>: choose bucket\n\n")
Expand Down
2 changes: 1 addition & 1 deletion ui/s3hub/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (m *s3hubRootModel) choicesView() string {
choices := fmt.Sprintf(
"%s\n%s\n%s\n%s\n",
ui.Checkbox("Create the S3 bucket", c == s3hubTopMinChoice),
ui.Checkbox("List S3 buckets (Download S3 Objects)", c == 1),
ui.Checkbox("List and download S3 objects", c == 1),
ui.Checkbox("Delete contents from the S3 bucket", c == 2),
ui.Checkbox("Delete the S3 bucket", c == s3hubTopMaxChoice),
)
Expand Down

0 comments on commit 79e274e

Please sign in to comment.