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 s3hub command interactive UI without logic #6

Merged
merged 11 commits into from
Dec 26, 2023

Conversation

nao1215
Copy link
Owner

@nao1215 nao1215 commented Dec 25, 2023

No description provided.

ui/common.go Outdated Show resolved Hide resolved
ui/common.go Outdated Show resolved Hide resolved
ui/common.go Outdated Show resolved Hide resolved
ui/common.go Outdated Show resolved Hide resolved
ui/s3hub.go Show resolved Hide resolved
ui/s3hub.go Show resolved Hide resolved
ui/s3hub.go Show resolved Hide resolved
ui/s3hub.go Show resolved Hide resolved
ui/common.go Show resolved Hide resolved
ui/s3hub.go Show resolved Hide resolved
// Make sure these keys always quit
if msg, ok := msg.(tea.KeyMsg); ok {
k := msg.String()
if k == "q" || k == "esc" || k == "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)

This comment has been minimized.

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)

// Make sure these keys always quit
if msg, ok := msg.(tea.KeyMsg); ok {
k := msg.String()
if k == "q" || k == "esc" || k == "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 esc has 5 occurrences, make it a constant (goconst)

ui/s3hub.go Outdated

switch msg := msg.(type) {
case tea.KeyMsg:
switch 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 🐶
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())

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.

@@ -0,0 +1,2 @@
// Package service

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

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.

// Make sure these keys always quit
if msg, ok := msg.(tea.KeyMsg); ok {
k := msg.String()
if k == "q" || k == "esc" || k == "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 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())

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

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

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.

return fmt.Sprintf(
"%s\n%s",
"s3hubListBucketModel",
subtle("j/k, up/down: select")+" | "+subtle("enter: choose")+" | "+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 8 occurrences, make it a constant (goconst)

@@ -0,0 +1,53 @@
// Packgae external provides external dependencies.

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)

Copy link

HOTTEST report

PASS FAIL SKIP TOTAL DURATION
71 0 1 72 16.275462205s

Reported by hottest

Copy link

Code Metrics Report

main (4070010) #6 (983f283) +/-
Coverage 62.2% 28.2% -33.9%
Test Execution Time 11s 25s +14s
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%)

Files Coverage +/-
app/di/wire_gen.go 0.0% 0.0%
app/domain/model/aws.go 36.8% +36.8%
app/domain/model/s3.go 97.8% +97.8%
app/external/s3.go 0.0% 0.0%
app/interactor/s3.go 0.0% 0.0%
cmd/subcmd/s3hub/interactive.go 0.0% -100.0%
ui/common.go 8.3% +8.3%
ui/s3hub.go 0.0% 0.0%
utils/errfmt/errfmt.go 100.0% +100.0%
utils/xregex/xregex.go 100.0% +100.0%

Reported by octocov

@nao1215 nao1215 merged commit d7663a7 into main Dec 26, 2023
9 checks passed
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