-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
This comment has been minimized.
This comment has been minimized.
type s3hubCreateBucketState int | ||
|
||
const ( | ||
s3hubCreateBucketStateNone s3hubCreateBucketState = 0 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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": |
There was a problem hiding this comment.
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": |
There was a problem hiding this comment.
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": |
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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.
This comment has been minimized.
This comment has been minimized.
HOTTEST report
Reported by hottest |
Code Metrics Report
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%)
Reported by octocov |
No description provided.