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
|
||||
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
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
|
||||
// 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:
|
||||
|
4
style.go
4
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user