Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Text User Interface for s3 bucket list #32

Merged
merged 4 commits into from
Jan 10, 2024
Merged

Conversation

nao1215
Copy link
Owner

@nao1215 nao1215 commented Jan 9, 2024

No description provided.

ui/s3hub.go Outdated Show resolved Hide resolved
ui/s3hub.go Outdated Show resolved Hide resolved
ui/s3hub.go Outdated Show resolved Hide resolved

This comment has been minimized.

type s3hubCreateBucketState int

const (
s3hubCreateBucketStateNone s3hubCreateBucketState = 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
s3hubCreateBucketStateNone is unused (deadcode)

// s3hubListBucketStatusBucketListed is the status when the list bucket operation is executed and the bucket list is displayed.
s3hubListBucketStatusBucketListed
// s3hubListBucketStatusObjectListed is the status when the list bucket operation is executed and the object list is displayed.
s3hubListBucketStatusObjectListed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
s3hubListBucketStatusObjectListed is unused (deadcode)

m.app = app
m.bucket = model.Bucket(m.bucketNameInput.Value())
return m, m.createS3BucketCmd()
case "ctrl+c":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
string ctrl+c has 6 occurrences, make it a constant (goconst)

return m, m.createS3BucketCmd()
case "ctrl+c":
return m, tea.Quit
case "esc":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
string esc has 6 occurrences, make it a constant (goconst)

switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "down":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
string down has 3 occurrences, make it a constant (goconst)

return fmt.Sprintf(
"%s\n%s",
"s3hubDeleteContentsModel",
ui.Subtle("j/k, up/down: select")+" | "+ui.Subtle("enter: choose")+" | "+ui.Subtle("q, esc: quit"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
string | has 6 occurrences, make it a constant (goconst)

startIndex = len(m.bucketSets) - windowHeight
endIndex = len(m.bucketSets)
}
} else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)


// updateChoices updates the model based on keypresses.
func (m *s3hubRootModel) updateChoices(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
singleCaseSwitch: should rewrite switch statement to if statement (gocritic)

ui/s3hub/list.go Outdated
func (m *s3hubListBucketModel) View() string {
if m.err != nil {
m.status = s3hubListBucketStatusQuit
return fmt.Sprintf("%s", ui.ErrorMessage(m.err))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)

ui/s3hub/root.go Outdated
// View renders the application's UI.
func (m *s3hubRootModel) View() string {
if m.err != nil {
return fmt.Sprintf("%s", m.err.Error())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)

This comment has been minimized.

This comment has been minimized.

Copy link

HOTTEST report

PASS FAIL SKIP TOTAL DURATION
262 0 7 269 9.182330185s

Reported by hottest

Copy link

Code Metrics Report

main (043777b) #32 (b9b9054) +/-
Coverage 37.0% 34.3% -2.8%
Test Execution Time 32s 16s -16s
Details
  |                     | main (043777b) | #32 (b9b9054) |  +/-  |
  |---------------------|----------------|---------------|-------|
- | Coverage            |          37.0% |         34.3% | -2.8% |
  |   Files             |             29 |            33 |    +4 |
  |   Lines             |            967 |          1045 |   +78 |
  |   Covered           |            358 |           358 |     0 |
+ | Test Execution Time |            32s |           16s |  -16s |

Code coverage of files in pull request scope (0.6% → 0.4%)

Files Coverage +/-
cmd/subcmd/s3hub/interactive.go 0.0% 0.0%
ui/common.go 4.0% -4.3%
ui/s3hub.go 0.0% 0.0%
ui/s3hub/create.go 0.0% 0.0%
ui/s3hub/delete.go 0.0% 0.0%
ui/s3hub/download.go 0.0% 0.0%
ui/s3hub/list.go 0.0% 0.0%
ui/s3hub/root.go 0.0% 0.0%

Reported by octocov

@nao1215 nao1215 merged commit 8f47245 into main Jan 10, 2024
7 checks passed
@nao1215 nao1215 changed the title Introduce bucket list Introduce Text User Interface for s3 bucket list Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant