diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml new file mode 100644 index 0000000..f0a41bb --- /dev/null +++ b/.github/workflows/go-test.yml @@ -0,0 +1,18 @@ +name: Go Test Workflow + +on: [pull_request] + +jobs: + go-test-service: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - name: Run go test + run: cd src && go test -v ./... diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..7af2b4c --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,21 @@ +name: Lint Workflow + +on: [pull_request] + +jobs: + golangci-lint-service: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest + diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..78c27c4 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,163 @@ +--- +# golangci-lint configuration file made by @ccoVeille +# Source: https://github.com/ccoVeille/golangci-lint-config-examples/ +# Author: @ccoVeille +# License: MIT +# Variant: 03-safe +# Version: v1.1.0 +# +linters: + # some linters are enabled by default + # https://golangci-lint.run/usage/linters/ + # + # enable some extra linters + enable: + # Errcheck is a program for checking for unchecked errors in Go code. + - errcheck + + # Linter for Go source code that specializes in simplifying code. + - gosimple + + # Vet examines Go source code and reports suspicious constructs. + - govet + + # Detects when assignments to existing variables are not used. + - ineffassign + + # It's a set of rules from staticcheck. See https://staticcheck.io/ + - staticcheck + + # Fast, configurable, extensible, flexible, and beautiful linter for Go. + # Drop-in replacement of golint. + - revive + + # check imports order and makes it always deterministic. + # - gci + - goimports + + # make sure to use t.Helper() when needed + - thelper + + # mirror suggests rewrites to avoid unnecessary []byte/string conversion + - mirror + + # detect the possibility to use variables/constants from the Go standard library. + - usestdlibvars + + # Finds commonly misspelled English words. + - misspell + + # Checks for duplicate words in the source code. + - dupword + + # linter to detect errors invalid key values count + - loggercheck + + # detects nested contexts in loops or function literals + - fatcontext + +linters-settings: + gci: # define the section orders for imports + sections: + # Standard section: captures all standard packages. + - standard + # Default section: catchall that is not standard or custom + - default + # linters that related to local tool, so they should be separated + - localmodule + + revive: + rules: + # these are the default revive rules + # you can remove the whole "rules" node if you want + # BUT + # ! /!\ they all need to be present when you want to add more rules than the default ones + # otherwise, you won't have the default rules, but only the ones you define in the "rules" node + + # Blank import should be only in a main or test package, or have a comment justifying it. + - name: blank-imports + + # context.Context() should be the first parameter of a function when provided as argument. + - name: context-as-argument + arguments: + - allowTypesBefore: "*testing.T" + + # Basic types should not be used as a key in `context.WithValue` + - name: context-keys-type + + # Importing with `.` makes the programs much harder to understand + - name: dot-imports + + # Empty blocks make code less readable and could be a symptom of a bug or unfinished refactoring. + - name: empty-block + + # for better readability, variables of type `error` must be named with the prefix `err`. + - name: error-naming + + # for better readability, the errors should be last in the list of returned values by a function. + - name: error-return + + # for better readability, error messages should not be capitalized or end with punctuation or a newline. + - name: error-strings + + # report when replacing `errors.New(fmt.Sprintf())` with `fmt.Errorf()` is possible + - name: errorf + + # incrementing an integer variable by 1 is recommended to be done using the `++` operator + - name: increment-decrement + + # highlights redundant else-blocks that can be eliminated from the code + - name: indent-error-flow + + # This rule suggests a shorter way of writing ranges that do not use the second value. + - name: range + + # receiver names in a method should reflect the struct name (p for Person, for example) + - name: receiver-naming + + # redefining built in names (true, false, append, make) can lead to bugs very difficult to detect. + - name: redefines-builtin-id + + # redundant else-blocks that can be eliminated from the code. + - name: superfluous-else + + # prevent confusing name for variables when using `time` package + - name: time-naming + + # warns when an exported function or method returns a value of an un-exported type. + - name: unexported-return + + # spots and proposes to remove unreachable code. also helps to spot errors + - name: unreachable-code + + # Functions or methods with unused parameters can be a symptom of an unfinished refactoring or a bug. + - name: unused-parameter + + # report when a variable declaration can be simplified + - name: var-declaration + + # warns when initialism, variable or package naming conventions are not followed. + - name: var-naming + + dupword: + # Keywords used to ignore detection. + # Default: [] + ignore: + # - "blah" # this will accept "blah blah …" as a valid duplicate word + + misspell: + # Correct spellings using locale preferences for US or UK. + # Setting locale to US will correct the British spelling of 'colour' to 'color'. + # Default ("") is to use a neutral variety of English. + locale: US + + # List of words to ignore + # among the one defined in https://github.com/golangci/misspell/blob/master/words.go + ignore-words: + # - valor + # - and + + # Extra word corrections. + extra-words: + # - typo: "whattever" + # correction: "whatever" diff --git a/main.go b/main.go index 1f51dfa..6e68262 100644 --- a/main.go +++ b/main.go @@ -3,24 +3,25 @@ package main import ( "flag" "fmt" - kaizen "github.com/serene-brew/Kaizen/src" "os" "os/exec" + + kaizen "github.com/serene-brew/Kaizen/src" ) // Main entrypoint for the application func main() { - //perform auto-heal check before starting kaizen + // perform auto-heal check before starting kaizen kaizen.AutoHeal() - //check whether MPV-player is installed or not + // check whether MPV-player is installed or not _, err := exec.LookPath("mpv") if err != nil { fmt.Println("[!] Please install MPV-player using your package manager before running kaizen") os.Exit(1) } - //kaizen CLI flags + // kaizen CLI flags uninstalFlag := flag.Bool("uninstall", false, "Run the uninstaller script") updateFlag := flag.Bool("update", false, "Run the update script") versionFlag := flag.Bool("v", false, "views version information") diff --git a/src/APIcore.go b/src/APIcore.go index 04e5fc1..0d5c599 100644 --- a/src/APIcore.go +++ b/src/APIcore.go @@ -95,9 +95,9 @@ If an error occurs at any point, it is returned along with an empty string. resp -> string [Stream link] */ func getStreamLink(id string, espisodeType string, episodeNumber string) (string, error) { - apiUrl := "https://heavenscape.vercel.app/api/anime/search/" + id + "/" + espisodeType + "/" + episodeNumber + apiURL := "https://heavenscape.vercel.app/api/anime/search/" + id + "/" + espisodeType + "/" + episodeNumber - resp, err := http.Get(apiUrl) + resp, err := http.Get(apiURL) if err != nil { return "", err } diff --git a/src/WatchAnime.go b/src/WatchAnime.go index f567371..46b6cd7 100644 --- a/src/WatchAnime.go +++ b/src/WatchAnime.go @@ -18,34 +18,36 @@ var ( keys = newKeyMap() ) -type focus int -type Tab1Model struct { - focus focus - styles Tab1styles - inputM textinput.Model - listOne list.Model - listTwo list.Model - table table.Model - spinner spinner.Model - - loading bool - loadingMSG string - data [][]interface{} - - width int - height int - - animeID string - animeName string - subEpisodeNumber int - dubEpisodeNumber int - subSelectedNum string - dubSelectedNum string - episodeType string - streamLink string - availableSubEpisodes []string - availableDubEpisodes []string -} +type ( + focus int + Tab1Model struct { + focus focus + styles Tab1styles + inputM textinput.Model + listOne list.Model + listTwo list.Model + table table.Model + spinner spinner.Model + + loading bool + loadingMSG string + data [][]interface{} + + width int + height int //nolint:unused + + animeID string + animeName string + subEpisodeNumber int + dubEpisodeNumber int + subSelectedNum string + dubSelectedNum string + episodeType string + streamLink string + availableSubEpisodes []string + availableDubEpisodes []string + } +) type item struct { title string @@ -86,7 +88,7 @@ func NewTab1Model() Tab1Model { spin := spinner.New() spin.Spinner = spinner.Dot - spin.Style = lipgloss.NewStyle().Foreground(lipgloss.Color(conf.Tab1_SpinnerColor)) + spin.Style = lipgloss.NewStyle().Foreground(lipgloss.Color(conf.Tab1SpinnerColor)) columns := []table.Column{ {Title: "", Width: 10}, @@ -238,7 +240,6 @@ func (m Tab1Model) Update(msg tea.Msg) (Tab1Model, tea.Cmd) { m.styles.list2Border = m.styles.list2Border.BorderForeground(lipgloss.Color(m.styles.inactiveColor)) m.styles.tableBorder = m.styles.tableBorder.BorderForeground(lipgloss.Color(m.styles.inactiveColor)) } - } else if m.focus == listOneFocus { m.streamSubAnime() m.styles.inputBorder = m.styles.inputBorder.BorderForeground(lipgloss.Color(m.styles.inactiveColor)) @@ -254,7 +255,6 @@ func (m Tab1Model) Update(msg tea.Msg) (Tab1Model, tea.Cmd) { } return m, nil } - } // Update the active component based on focus, and return a batch of commands @@ -314,7 +314,7 @@ func (m Tab1Model) View() string { ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣴⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣶⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣾⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠛⠛⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⣿⣶⣶⣶⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⡿⠛⠛⠛⠛⠉⠉⠉⠉⠉⠉⠉` - asciiS := lipgloss.NewStyle().Foreground(lipgloss.Color(conf.Tab1_kaizen_AscciArtColor)) + asciiS := lipgloss.NewStyle().Foreground(lipgloss.Color(conf.Tab1KaizenAscciArtColor)) if m.loading { return lipgloss.JoinVertical( lipgloss.Top, @@ -322,7 +322,7 @@ func (m Tab1Model) View() string { lipgloss.JoinHorizontal( lipgloss.Top, m.spinner.View(), - lipgloss.NewStyle().Foreground(lipgloss.Color(conf.Tab1_SpinnerMsgColor)).Render(m.loadingMSG)), + lipgloss.NewStyle().Foreground(lipgloss.Color(conf.Tab1SpinnerMsgColor)).Render(m.loadingMSG)), tableS, lipgloss.JoinHorizontal( lipgloss.Top, diff --git a/src/about.go b/src/about.go index 0093ca8..26cda91 100644 --- a/src/about.go +++ b/src/about.go @@ -15,7 +15,7 @@ func (m Tab2Model) Init() tea.Cmd { return nil } -func (m Tab2Model) Update(msg tea.Msg) (Tab2Model, tea.Cmd) { +func (m Tab2Model) Update(_ tea.Msg) (Tab2Model, tea.Cmd) { // Tab2 doesn't react to input, just static content return m, nil } @@ -41,7 +41,7 @@ func (m Tab2Model) View() string { link := lipgloss.NewStyle().Foreground(lipgloss.Color("#43BF6D")).Render - ui := lipgloss.JoinVertical(lipgloss.Center, lipgloss.NewStyle().Foreground(lipgloss.Color(conf.defaultActiveTab_dark)).Render("kaizen")) + ui := lipgloss.JoinVertical(lipgloss.Center, lipgloss.NewStyle().Foreground(lipgloss.Color(conf.defaultActiveTabDark)).Render("kaizen")) desc := `Ever feel like your terminal was missing something? Like, sure, it can handle your code, your servers, and maybe a cheeky game of Snake. @@ -60,28 +60,28 @@ Enjoy your experience, and let Kaizen be your companion on your journey into the lipgloss.WithWhitespaceForeground(lipgloss.Color("#383838")), ) - mintRaven_github := link("https://github.com/mintRaven-05") - riserSama_github := link("https://github.com/ImonChakraborty") - sereneBrew_github := link("https://github.com/serene-brew") - dev_community := link("https://dev.to/serene-brew") + mintRavenGithub := link("https://github.com/mintRaven-05") + riserSamaGithub := link("https://github.com/ImonChakraborty") + sereneBrewGithub := link("https://github.com/serene-brew") + devCommunity := link("https://dev.to/serene-brew") - short_title1 := "Want to see more from us? Follow us on our socials.\n" - socials := "•" + mintRaven_github + "\n•" + riserSama_github + "\n" - socials_end := "(github is the only social life we have)\n" - socialsText := short_title1 + socials + socials_end + shortTitle1 := "Want to see more from us? Follow us on our socials.\n" + socials := "•" + mintRavenGithub + "\n•" + riserSamaGithub + "\n" + socialsEnd := "(github is the only social life we have)\n" + socialsText := shortTitle1 + socials + socialsEnd - short_title2 := "Check out the latest project from\n" - github := "•" + sereneBrew_github + "\n" - github_end := "Found a bug? Report at the project repository.\n\n" - serene_brew := short_title2 + github + github_end + shortTitle2 := "Check out the latest project from\n" + github := "•" + sereneBrewGithub + "\n" + githubEnd := "Found a bug? Report at the project repository.\n\n" + sereneBrew := shortTitle2 + github + githubEnd - short_title3 := "keep up with our latest posts and news at\n" - dev := "•" + dev_community + "\n" - dev_end := "(dev.to is another social life we have for now)\n\n" - dev_text := short_title3 + dev + dev_end + shortTitle3 := "keep up with our latest posts and news at\n" + dev := "•" + devCommunity + "\n" + devEnd := "(dev.to is another social life we have for now)\n\n" + devText := shortTitle3 + dev + devEnd email := link("\t serene.brew.git@gmail.com") - email_text := "\t ~developed by mintRaven & RiserSama\n" + email + emailText := "\t ~developed by mintRaven & RiserSama\n" + email return lipgloss.JoinVertical( lipgloss.Top, @@ -94,7 +94,7 @@ Enjoy your experience, and let Kaizen be your companion on your journey into the LinksStyle.Render(socialsText), lipgloss.JoinVertical( lipgloss.Top, - LinksStyle.Render(serene_brew), - FooterStyle.Render(email_text)), - LinksStyle.Render(dev_text))) + LinksStyle.Render(sereneBrew), + FooterStyle.Render(emailText)), + LinksStyle.Render(devText))) } diff --git a/src/appState_test.go b/src/appState_test.go index 8eb43d6..c382b80 100644 --- a/src/appState_test.go +++ b/src/appState_test.go @@ -1,8 +1,9 @@ package src import ( - tea "github.com/charmbracelet/bubbletea" "testing" + + tea "github.com/charmbracelet/bubbletea" ) func TestAppStateSimulation(t *testing.T) { diff --git a/src/config.go b/src/config.go index bf2b508..e2420bc 100644 --- a/src/config.go +++ b/src/config.go @@ -2,11 +2,12 @@ package src import ( "fmt" - "github.com/spf13/viper" "os" "os/exec" "path/filepath" "time" + + "github.com/spf13/viper" ) /* Config struct defines the color configuration for different elements of the application. @@ -14,20 +15,20 @@ import ( * for Tab1 such as focus state, table selection, spinner, and ASCII art colors.*/ type Config struct { - defaultForeground_light string - defaultForeground_dark string - defaultUnfocused_light string - defaultUnfocused_dark string - defaultActiveTab_light string - defaultActiveTab_dark string - - Tab1_FocusActive string - Tab1_FocusInactive string - Tab1_TableSelectedBackground string - Tab1_TableSelectedForeground string - Tab1_SpinnerColor string - Tab1_SpinnerMsgColor string - Tab1_kaizen_AscciArtColor string + defaultForegroundLight string + defaultForegroundDark string + defaultUnfocusedLight string + defaultUnfocusedDark string + defaultActiveTabLight string + defaultActiveTabDark string + + Tab1FocusActive string + Tab1FocusInactive string + Tab1TableSelectedBackground string + Tab1TableSelectedForeground string + Tab1SpinnerColor string + Tab1SpinnerMsgColor string + Tab1KaizenAscciArtColor string } /* LoadConfig function initializes the Config struct by reading values from a YAML configuration file. @@ -69,35 +70,35 @@ func LoadConfig() Config { var conf Config - defaultForeground_dark := viper.GetString("DefaultForeground.dark") - defaultForeground_light := viper.GetString("DefaultForeground.light") - defaultUnfocused_light := viper.GetString("DefaultUnfocused.light") - defaultUnfocused_dark := viper.GetString("DefaultUnfocused.dark") - defaultActiveTab_light := viper.GetString("DefaultActiveTab.light") - defaultActiveTab_dark := viper.GetString("DefaultActiveTab.dark") - - Tab1_FocusActive := viper.GetString("Tab1.focus.active") - Tab1_FocusInactive := viper.GetString("Tab1.focus.inactive") - Tab1_TableSelectedForeground := viper.GetString("Tab1.table.selected.foreground") - Tab1_TableSelectedBackground := viper.GetString("Tab1.table.selected.background") - Tab1_SpinnerColor := viper.GetString("Tab1.spinner.color") - Tab1_SpinnerMsgColor := viper.GetString("Tab1.spinner.msg.color") - Tab1_kaizen_AscciArtColor := viper.GetString("Tab1.ASCII Art.color") - - conf.defaultUnfocused_dark = defaultUnfocused_dark - conf.defaultUnfocused_light = defaultUnfocused_light - conf.defaultForeground_light = defaultForeground_light - conf.defaultForeground_dark = defaultForeground_dark - conf.defaultActiveTab_light = defaultActiveTab_light - conf.defaultActiveTab_dark = defaultActiveTab_dark - - conf.Tab1_FocusActive = Tab1_FocusActive - conf.Tab1_FocusInactive = Tab1_FocusInactive - conf.Tab1_TableSelectedForeground = Tab1_TableSelectedForeground - conf.Tab1_TableSelectedBackground = Tab1_TableSelectedBackground - conf.Tab1_SpinnerColor = Tab1_SpinnerColor - conf.Tab1_SpinnerMsgColor = Tab1_SpinnerMsgColor - conf.Tab1_kaizen_AscciArtColor = Tab1_kaizen_AscciArtColor + defaultForegroundDark := viper.GetString("DefaultForeground.dark") + defaultForegroundLight := viper.GetString("DefaultForeground.light") + defaultUnfocusedLight := viper.GetString("DefaultUnfocused.light") + defaultUnfocusedDark := viper.GetString("DefaultUnfocused.dark") + defaultActiveTabLight := viper.GetString("DefaultActiveTab.light") + defaultActiveTabDark := viper.GetString("DefaultActiveTab.dark") + + Tab1FocusActive := viper.GetString("Tab1.focus.active") + Tab1FocusInactive := viper.GetString("Tab1.focus.inactive") + Tab1TableSelectedForeground := viper.GetString("Tab1.table.selected.foreground") + Tab1TableSelectedBackground := viper.GetString("Tab1.table.selected.background") + Tab1SpinnerColor := viper.GetString("Tab1.spinner.color") + Tab1SpinnerMsgColor := viper.GetString("Tab1.spinner.msg.color") + Tab1KaizenAscciArtColor := viper.GetString("Tab1.ASCII Art.color") + + conf.defaultUnfocusedDark = defaultUnfocusedDark + conf.defaultUnfocusedLight = defaultUnfocusedLight + conf.defaultForegroundLight = defaultForegroundLight + conf.defaultForegroundDark = defaultForegroundDark + conf.defaultActiveTabLight = defaultActiveTabLight + conf.defaultActiveTabDark = defaultActiveTabDark + + conf.Tab1FocusActive = Tab1FocusActive + conf.Tab1FocusInactive = Tab1FocusInactive + conf.Tab1TableSelectedForeground = Tab1TableSelectedForeground + conf.Tab1TableSelectedBackground = Tab1TableSelectedBackground + conf.Tab1SpinnerColor = Tab1SpinnerColor + conf.Tab1SpinnerMsgColor = Tab1SpinnerMsgColor + conf.Tab1KaizenAscciArtColor = Tab1KaizenAscciArtColor return conf } diff --git a/src/mainModel.go b/src/mainModel.go index 6f7cf51..947cb85 100644 --- a/src/mainModel.go +++ b/src/mainModel.go @@ -2,12 +2,13 @@ package src import ( "fmt" + "strings" + "github.com/charmbracelet/bubbles/key" "github.com/charmbracelet/bubbles/list" "github.com/charmbracelet/bubbles/spinner" tea "github.com/charmbracelet/bubbletea" gloss "github.com/charmbracelet/lipgloss" - "strings" ) type AppState int @@ -56,7 +57,7 @@ func (m MainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.currentScreen = AppScreen } case tea.KeyMsg: - //this switch handles when to show AppScreen and when to overlay the ErrorScreen over the AppScreen + // this switch handles when to show AppScreen and when to overlay the ErrorScreen over the AppScreen switch m.currentScreen { case AppScreen: switch msg.String() { diff --git a/src/shared.go b/src/shared.go index d0e82e9..f45970f 100644 --- a/src/shared.go +++ b/src/shared.go @@ -169,8 +169,7 @@ func AutoHeal() { if err := uninstallModCmd.Run(); err != nil { fmt.Fprintf(os.Stderr, "\033[0;33m [!] Error running shell code: %v \033[0m \n", err) os.Exit(1) - } - + } time.Sleep(2 * time.Second) fmt.Println("\033[0;32m [+] config.yaml configure at ~/.config/kaizen/ \033[0m") diff --git a/src/styles.go b/src/styles.go index 3da7e0a..cd5efdb 100644 --- a/src/styles.go +++ b/src/styles.go @@ -41,9 +41,9 @@ Default colors and borders are defined here as adaptive properties to support li These settings provide a cohesive appearance across different themes. */ var ( - DefaultForegroundColor = gloss.AdaptiveColor{Light: conf.defaultUnfocused_light, Dark: conf.defaultForeground_dark} - DefaultUnfocusedColor = gloss.AdaptiveColor{Light: conf.defaultUnfocused_light, Dark: conf.defaultUnfocused_dark} - DefaultActiveTabIndicatorColor = gloss.AdaptiveColor{Light: conf.defaultActiveTab_light, Dark: conf.defaultActiveTab_dark} + DefaultForegroundColor = gloss.AdaptiveColor{Light: conf.defaultUnfocusedLight, Dark: conf.defaultForegroundDark} + DefaultUnfocusedColor = gloss.AdaptiveColor{Light: conf.defaultUnfocusedLight, Dark: conf.defaultUnfocusedDark} + DefaultActiveTabIndicatorColor = gloss.AdaptiveColor{Light: conf.defaultActiveTabLight, Dark: conf.defaultActiveTabDark} DefaultWindowBorder = gloss.Border{ Top: " ", @@ -83,7 +83,7 @@ var ( BottomRight: "┐", } - thinRoundedBorder = gloss.Border{ + thinRoundedBorder = gloss.Border{ //nolint:unused Top: "─", Bottom: "─", Left: "│", @@ -94,19 +94,19 @@ var ( BottomRight: "╯", } - tableStyle = gloss.NewStyle(). + tableStyle = gloss.NewStyle(). //nolint:unused Border(thinRoundedBorder). BorderForeground(gloss.Color("63")) - headerStyle = gloss.NewStyle(). + headerStyle = gloss.NewStyle(). //nolint:unused Bold(true). Foreground(gloss.Color("208")) - selectedStyle = gloss.NewStyle(). + selectedStyle = gloss.NewStyle(). //nolint:unused Foreground(gloss.Color("229")). Background(gloss.Color("63")) - contentStyle = gloss.NewStyle(). + contentStyle = gloss.NewStyle(). //nolint:unused Border(DefaultWindowBorder, true). BorderForeground(DefaultForegroundColor) @@ -158,22 +158,22 @@ func Tab1Styles() Tab1styles { return Tab1styles{ list1Border: gloss.NewStyle(). Border(gloss.RoundedBorder()). - BorderForeground(gloss.Color(conf.Tab1_FocusInactive)). + BorderForeground(gloss.Color(conf.Tab1FocusInactive)). Padding(1), list2Border: gloss.NewStyle(). Border(gloss.RoundedBorder()). - BorderForeground(gloss.Color(conf.Tab1_FocusInactive)). + BorderForeground(gloss.Color(conf.Tab1FocusInactive)). Padding(1), inputBorder: gloss.NewStyle(). Border(gloss.RoundedBorder()). - BorderForeground(gloss.Color(conf.Tab1_FocusActive)). + BorderForeground(gloss.Color(conf.Tab1FocusActive)). Padding(1), tableBorder: gloss.NewStyle(). Border(gloss.RoundedBorder()). - BorderForeground(gloss.Color(conf.Tab1_FocusInactive)). + BorderForeground(gloss.Color(conf.Tab1FocusInactive)). Padding(1), - activeColor: conf.Tab1_FocusActive, // Orange - inactiveColor: conf.Tab1_FocusInactive, // Gray + activeColor: conf.Tab1FocusActive, // Orange + inactiveColor: conf.Tab1FocusInactive, // Gray } } @@ -190,8 +190,8 @@ func getTableStyles() table.Styles { Bold(false) s.Selected = s.Selected. - Foreground(gloss.Color(conf.Tab1_TableSelectedForeground)). - Background(gloss.Color(conf.Tab1_TableSelectedBackground)). + Foreground(gloss.Color(conf.Tab1TableSelectedForeground)). + Background(gloss.Color(conf.Tab1TableSelectedBackground)). Bold(false) return s diff --git a/src/utils.go b/src/utils.go index 2eaf8be..1e810df 100644 --- a/src/utils.go +++ b/src/utils.go @@ -46,7 +46,7 @@ func (m *Tab1Model) streamSubAnime() { if m.streamLink != "" { streamTitle := fmt.Sprintf("--force-media-title=%s Episode %s (SUB)", m.animeName, m.subSelectedNum) stream := exec.Command("mpv", "-fs", m.streamLink, streamTitle) - stream.Output() + stream.Output() //nolint:errcheck } else { fmt.Println("no link found") } @@ -68,7 +68,7 @@ func (m *Tab1Model) streamDubAnime() { if m.streamLink != "" { streamTitle := fmt.Sprintf("--force-media-title=%s Episode %s (DUB)", m.animeName, m.dubSelectedNum) stream := exec.Command("mpv", "-fs", m.streamLink, streamTitle) - stream.Output() + stream.Output() //nolint:errcheck } else { fmt.Println("no link found") }