-
-
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 s3hub command interactive UI without logic #6
Conversation
// Make sure these keys always quit | ||
if msg, ok := msg.(tea.KeyMsg); ok { | ||
k := msg.String() | ||
if k == "q" || k == "esc" || k == "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)
This comment has been minimized.
This comment has been minimized.
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)
// Make sure these keys always quit | ||
if msg, ok := msg.(tea.KeyMsg); ok { | ||
k := msg.String() | ||
if k == "q" || k == "esc" || k == "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 esc
has 5 occurrences, make it a constant (goconst)
ui/s3hub.go
Outdated
|
||
switch msg := msg.(type) { | ||
case tea.KeyMsg: | ||
switch 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 🐶
missing cases in switch of type tea.KeyType: tea.KeyNull|tea.KeyCtrlAt, tea.KeyBackspace|tea.KeyCtrlQuestionMark, tea.KeyTab|tea.KeyCtrlI, tea.KeyCtrlA, tea.KeyCtrlB, tea.KeyCtrlD, tea.KeyCtrlE, tea.KeyCtrlF, tea.KeyCtrlG, tea.KeyCtrlH, tea.KeyCtrlJ, tea.KeyCtrlK, tea.KeyCtrlL, tea.KeyCtrlN, tea.KeyCtrlO, tea.KeyCtrlP, tea.KeyCtrlQ, tea.KeyCtrlR, tea.KeyCtrlS, tea.KeyCtrlT, tea.KeyCtrlU, tea.KeyCtrlV, tea.KeyCtrlW, tea.KeyCtrlX, tea.KeyCtrlY, tea.KeyCtrlZ, tea.KeyCtrlBackslash, tea.KeyCtrlCloseBracket, tea.KeyCtrlCaret, tea.KeyCtrlUnderscore, tea.KeyRunes, tea.KeyUp, tea.KeyDown, tea.KeyRight, tea.KeyLeft, tea.KeyShiftTab, tea.KeyHome, tea.KeyEnd, tea.KeyPgUp, tea.KeyPgDown, tea.KeyCtrlPgUp, tea.KeyCtrlPgDown, tea.KeyDelete, tea.KeyInsert, tea.KeySpace, tea.KeyCtrlUp, tea.KeyCtrlDown, tea.KeyCtrlRight, tea.KeyCtrlLeft, tea.KeyCtrlHome, tea.KeyCtrlEnd, tea.KeyShiftUp, tea.KeyShiftDown, tea.KeyShiftRight, tea.KeyShiftLeft, tea.KeyShiftHome, tea.KeyShiftEnd, tea.KeyCtrlShiftUp, tea.KeyCtrlShiftDown, tea.KeyCtrlShiftLeft, tea.KeyCtrlShiftRight, tea.KeyCtrlShiftHome, tea.KeyCtrlShiftEnd, tea.KeyF1, tea.KeyF2, tea.KeyF3, tea.KeyF4, tea.KeyF5, tea.KeyF6, tea.KeyF7, tea.KeyF8, tea.KeyF9, tea.KeyF10, tea.KeyF11, tea.KeyF12, tea.KeyF13, tea.KeyF14, tea.KeyF15, tea.KeyF16, tea.KeyF17, tea.KeyF18, tea.KeyF19, tea.KeyF20 (exhaustive)
ui/s3hub.go
Outdated
|
||
func (m *s3hubCreateBucketModel) 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.
@@ -0,0 +1,2 @@ | |||
// Package service |
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 🐶
ST1000: package comment should be of the form "Package service ..." (stylecheck)
@@ -0,0 +1 @@ | |||
package external |
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 🐶
ST1000: at least one file in a package should have a package comment (stylecheck)
This comment has been minimized.
This comment has been minimized.
// Make sure these keys always quit | ||
if msg, ok := msg.(tea.KeyMsg); ok { | ||
k := msg.String() | ||
if k == "q" || k == "esc" || k == "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 5 occurrences, make it a constant (goconst)
// 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)
@@ -0,0 +1,17 @@ | |||
package usecase |
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 🐶
ST1000: at least one file in a package should have a package comment (stylecheck)
@@ -0,0 +1,36 @@ | |||
package interactor |
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 🐶
ST1000: at least one file in a package should have a package comment (stylecheck)
This comment has been minimized.
This comment has been minimized.
return fmt.Sprintf( | ||
"%s\n%s", | ||
"s3hubListBucketModel", | ||
subtle("j/k, up/down: select")+" | "+subtle("enter: choose")+" | "+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 8 occurrences, make it a constant (goconst)
@@ -0,0 +1,53 @@ | |||
// Packgae external provides external dependencies. |
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 🐶
ST1000: package comment should be of the form "Package external ..." (stylecheck)
HOTTEST report
Reported by hottest |
Code Metrics Report
Details | | main (4070010) | #6 (983f283) | +/- |
|---------------------|----------------|--------------|--------|
- | Coverage | 62.2% | 28.2% | -33.9% |
| Files | 8 | 17 | +9 |
| Lines | 37 | 301 | +264 |
+ | Covered | 23 | 85 | +62 |
- | Test Execution Time | 11s | 25s | +14s | Code coverage of files in pull request scope (100.0% → 24.1%)
Reported by octocov |
No description provided.