chore(lint): add nolint directives

This commit is contained in:
Christian Rocha 2024-05-01 15:59:11 -04:00
parent 2b58c4b607
commit 9f111af5aa
No known key found for this signature in database
GPG Key ID: 589F6FDD5B820611
3 changed files with 8 additions and 8 deletions

6
get.go
View File

@ -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:

6
set.go
View File

@ -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:

View File

@ -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
}