Mark innocuous numbers as nolint

This commit is contained in:
Christian Muehlhaeuser 2021-03-12 01:43:13 +01:00
parent 490a599c05
commit da9a4049de
2 changed files with 10 additions and 12 deletions

View File

@ -128,7 +128,7 @@ func NewModel(opts ...Option) (*Model, error) {
func (m Model) View(percent float64) string { func (m Model) View(percent float64) string {
b := strings.Builder{} b := strings.Builder{}
if m.ShowPercentage { if m.ShowPercentage {
percentage := fmt.Sprintf(m.PercentFormat, percent*100) percentage := fmt.Sprintf(m.PercentFormat, percent*100) //nolint:gomnd
if m.PercentageStyle != nil { if m.PercentageStyle != nil {
percentage = m.PercentageStyle.Styled(percentage) percentage = m.PercentageStyle.Styled(percentage)
} }

View File

@ -9,8 +9,6 @@ import (
"github.com/muesli/termenv" "github.com/muesli/termenv"
) )
const defaultFPS = time.Second / 10
// Spinner is a set of frames used in animating the spinner. // Spinner is a set of frames used in animating the spinner.
type Spinner struct { type Spinner struct {
Frames []string Frames []string
@ -21,39 +19,39 @@ var (
// Some spinners to choose from. You could also make your own. // Some spinners to choose from. You could also make your own.
Line = Spinner{ Line = Spinner{
Frames: []string{"|", "/", "-", "\\"}, Frames: []string{"|", "/", "-", "\\"},
FPS: time.Second / 10, FPS: time.Second / 10, //nolint:gomnd
} }
Dot = Spinner{ Dot = Spinner{
Frames: []string{"⣾ ", "⣽ ", "⣻ ", "⢿ ", "⡿ ", "⣟ ", "⣯ ", "⣷ "}, Frames: []string{"⣾ ", "⣽ ", "⣻ ", "⢿ ", "⡿ ", "⣟ ", "⣯ ", "⣷ "},
FPS: time.Second / 10, FPS: time.Second / 10, //nolint:gomnd
} }
MiniDot = Spinner{ MiniDot = Spinner{
Frames: []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}, Frames: []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"},
FPS: time.Second / 12, FPS: time.Second / 12, //nolint:gomnd
} }
Jump = Spinner{ Jump = Spinner{
Frames: []string{"⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"}, Frames: []string{"⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"},
FPS: time.Second / 10, FPS: time.Second / 10, //nolint:gomnd
} }
Pulse = Spinner{ Pulse = Spinner{
Frames: []string{"█", "▓", "▒", "░"}, Frames: []string{"█", "▓", "▒", "░"},
FPS: time.Second / 8, FPS: time.Second / 8, //nolint:gomnd
} }
Points = Spinner{ Points = Spinner{
Frames: []string{"∙∙∙", "●∙∙", "∙●∙", "∙∙●"}, Frames: []string{"∙∙∙", "●∙∙", "∙●∙", "∙∙●"},
FPS: time.Second / 7, FPS: time.Second / 7, //nolint:gomnd
} }
Globe = Spinner{ Globe = Spinner{
Frames: []string{"🌍", "🌎", "🌏"}, Frames: []string{"🌍", "🌎", "🌏"},
FPS: time.Second / 4, FPS: time.Second / 4, //nolint:gomnd
} }
Moon = Spinner{ Moon = Spinner{
Frames: []string{"🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"}, Frames: []string{"🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"},
FPS: time.Second / 8, FPS: time.Second / 8, //nolint:gomnd
} }
Monkey = Spinner{ Monkey = Spinner{
Frames: []string{"🙈", "🙉", "🙊"}, Frames: []string{"🙈", "🙉", "🙊"},
FPS: time.Second / 3, FPS: time.Second / 3, //nolint:gomnd
} }
color = termenv.ColorProfile().Color color = termenv.ColorProfile().Color