From 9f111af5aa9868b4cc56303b4094243d500f7dd0 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 1 May 2024 15:59:11 -0400 Subject: [PATCH] chore(lint): add nolint directives --- get.go | 6 +++--- set.go | 6 +++--- style.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/get.go b/get.go index 50eba51..5783f9a 100644 --- a/get.go +++ b/get.go @@ -432,7 +432,7 @@ func (s Style) getAsColor(k propKey) TerminalColor { } var c TerminalColor - switch k { + switch k { //nolint:exhaustive case foregroundKey: c = s.fgColor case backgroundKey: @@ -468,7 +468,7 @@ func (s Style) getAsInt(k propKey) int { if !s.isSet(k) { return 0 } - switch k { + switch k { //nolint:exhaustive case widthKey: return s.width case heightKey: @@ -503,7 +503,7 @@ func (s Style) getAsPosition(k propKey) Position { if !s.isSet(k) { return Position(0) } - switch k { + switch k { //nolint:exhaustive case alignHorizontalKey: return s.alignHorizontal case alignVerticalKey: diff --git a/set.go b/set.go index d4f4bff..6f8b082 100644 --- a/set.go +++ b/set.go @@ -6,7 +6,7 @@ func (s *Style) set(key propKey, value interface{}) { // them at zero or above. We could use uints instead, but the // conversions are a little tedious, so we're sticking with ints for // sake of usability. - switch key { + switch key { //nolint:exhaustive case foregroundKey: s.fgColor = colorOrNil(value) case backgroundKey: @@ -66,7 +66,7 @@ func (s *Style) set(key propKey, value interface{}) { case transformKey: s.transform = value.(func(string) string) default: - if v, ok := value.(bool); ok { + if v, ok := value.(bool); ok { //nolint:nestif if v { s.attrs |= int(key) } else { @@ -88,7 +88,7 @@ func (s *Style) set(key propKey, value interface{}) { // setFrom sets the property from another style. func (s *Style) setFrom(key propKey, i Style) { - switch key { + switch key { //nolint:exhaustive case foregroundKey: s.set(foregroundKey, i.fgColor) case backgroundKey: diff --git a/style.go b/style.go index 9e75272..b9c44fc 100644 --- a/style.go +++ b/style.go @@ -394,7 +394,7 @@ func (s Style) Render(strs ...string) string { } // Padding - if !inline { + if !inline { //nolint:nestif if leftPadding > 0 { var st *termenv.Style if colorWhitespace || styleWhitespace { @@ -564,7 +564,7 @@ func pad(str string, n int, style *termenv.Style) string { return b.String() } -func max(a, b int) int { // nolint:unparam +func max(a, b int) int { //nolint:unparam if a > b { return a }