mirror of
https://github.com/charmbracelet/lipgloss.git
synced 2024-08-17 18:00:46 +03:00
chore(lint): add nolint directives
This commit is contained in:
parent
2b58c4b607
commit
9f111af5aa
6
get.go
6
get.go
@ -432,7 +432,7 @@ func (s Style) getAsColor(k propKey) TerminalColor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var c TerminalColor
|
var c TerminalColor
|
||||||
switch k {
|
switch k { //nolint:exhaustive
|
||||||
case foregroundKey:
|
case foregroundKey:
|
||||||
c = s.fgColor
|
c = s.fgColor
|
||||||
case backgroundKey:
|
case backgroundKey:
|
||||||
@ -468,7 +468,7 @@ func (s Style) getAsInt(k propKey) int {
|
|||||||
if !s.isSet(k) {
|
if !s.isSet(k) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
switch k {
|
switch k { //nolint:exhaustive
|
||||||
case widthKey:
|
case widthKey:
|
||||||
return s.width
|
return s.width
|
||||||
case heightKey:
|
case heightKey:
|
||||||
@ -503,7 +503,7 @@ func (s Style) getAsPosition(k propKey) Position {
|
|||||||
if !s.isSet(k) {
|
if !s.isSet(k) {
|
||||||
return Position(0)
|
return Position(0)
|
||||||
}
|
}
|
||||||
switch k {
|
switch k { //nolint:exhaustive
|
||||||
case alignHorizontalKey:
|
case alignHorizontalKey:
|
||||||
return s.alignHorizontal
|
return s.alignHorizontal
|
||||||
case alignVerticalKey:
|
case alignVerticalKey:
|
||||||
|
6
set.go
6
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
|
// them at zero or above. We could use uints instead, but the
|
||||||
// conversions are a little tedious, so we're sticking with ints for
|
// conversions are a little tedious, so we're sticking with ints for
|
||||||
// sake of usability.
|
// sake of usability.
|
||||||
switch key {
|
switch key { //nolint:exhaustive
|
||||||
case foregroundKey:
|
case foregroundKey:
|
||||||
s.fgColor = colorOrNil(value)
|
s.fgColor = colorOrNil(value)
|
||||||
case backgroundKey:
|
case backgroundKey:
|
||||||
@ -66,7 +66,7 @@ func (s *Style) set(key propKey, value interface{}) {
|
|||||||
case transformKey:
|
case transformKey:
|
||||||
s.transform = value.(func(string) string)
|
s.transform = value.(func(string) string)
|
||||||
default:
|
default:
|
||||||
if v, ok := value.(bool); ok {
|
if v, ok := value.(bool); ok { //nolint:nestif
|
||||||
if v {
|
if v {
|
||||||
s.attrs |= int(key)
|
s.attrs |= int(key)
|
||||||
} else {
|
} else {
|
||||||
@ -88,7 +88,7 @@ func (s *Style) set(key propKey, value interface{}) {
|
|||||||
|
|
||||||
// setFrom sets the property from another style.
|
// setFrom sets the property from another style.
|
||||||
func (s *Style) setFrom(key propKey, i Style) {
|
func (s *Style) setFrom(key propKey, i Style) {
|
||||||
switch key {
|
switch key { //nolint:exhaustive
|
||||||
case foregroundKey:
|
case foregroundKey:
|
||||||
s.set(foregroundKey, i.fgColor)
|
s.set(foregroundKey, i.fgColor)
|
||||||
case backgroundKey:
|
case backgroundKey:
|
||||||
|
4
style.go
4
style.go
@ -394,7 +394,7 @@ func (s Style) Render(strs ...string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Padding
|
// Padding
|
||||||
if !inline {
|
if !inline { //nolint:nestif
|
||||||
if leftPadding > 0 {
|
if leftPadding > 0 {
|
||||||
var st *termenv.Style
|
var st *termenv.Style
|
||||||
if colorWhitespace || styleWhitespace {
|
if colorWhitespace || styleWhitespace {
|
||||||
@ -564,7 +564,7 @@ func pad(str string, n int, style *termenv.Style) string {
|
|||||||
return b.String()
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func max(a, b int) int { // nolint:unparam
|
func max(a, b int) int { //nolint:unparam
|
||||||
if a > b {
|
if a > b {
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user