Skip to content

Commit 64a3b6f

Browse files
committed
fix: lint
1 parent 9c6a385 commit 64a3b6f

File tree

15 files changed

+48
-55
lines changed

15 files changed

+48
-55
lines changed

command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ func ExecuteSetWindowBar(c parser.Command, v *VHS) error {
667667
return nil
668668
}
669669

670-
// ExecuteSetWindowBar sets window bar size.
670+
// ExecuteSetWindowBarSize sets window bar size.
671671
func ExecuteSetWindowBarSize(c parser.Command, v *VHS) error {
672672
windowBarSize, err := strconv.Atoi(c.Args)
673673
if err != nil {

draw.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func (r *roundedrect) At(x, y int) color.Color {
174174
return color.Alpha{white}
175175
}
176176

177-
// Make a mask to round a terminal's corners.
177+
// MakeBorderRadiusMask a mask to round a terminal's corners.
178178
func MakeBorderRadiusMask(width, height, radius int, targetpng string) {
179179
img := image.NewGray(
180180
image.Rectangle{
@@ -209,7 +209,7 @@ func MakeBorderRadiusMask(width, height, radius int, targetpng string) {
209209
}
210210
}
211211

212-
// Make a window bar and save it to a file.
212+
// MakeWindowBar a window bar and save it to a file.
213213
func MakeWindowBar(termWidth, termHeight int, opts StyleOptions, file string) {
214214
var err error
215215
switch opts.WindowBar {

evaluator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ func Evaluate(ctx context.Context, tape string, out io.Writer, opts ...Evaluator
7676
minHeight += video.Style.WindowBarSize
7777
}
7878
if video.Style.Height < minHeight || video.Style.Width < minWidth {
79+
//nolint:staticcheck
7980
v.Errors = append(
8081
v.Errors,
8182
fmt.Errorf(

examples/gum/src/lipgloss/align.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package lipgloss is an example package.
12
package lipgloss
23

34
// Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.

examples/neofetch/colorize-ascii.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Package neofetch is an example package.
2+
//
3+
//nolint:unused
14
package neofetch
25

36
import (
@@ -41,17 +44,3 @@ func clamp(v, low, high int) int {
4144
}
4245
return min(high, max(low, v))
4346
}
44-
45-
func min(a, b int) int {
46-
if a < b {
47-
return a
48-
}
49-
return b
50-
}
51-
52-
func max(a, b int) int {
53-
if a > b {
54-
return a
55-
}
56-
return b
57-
}

ffmpeg.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ func calcTermDimensions(style StyleOptions) (int, int) {
112112
func (fb *FilterComplexBuilder) WithWindowBar(barStream int) *FilterComplexBuilder {
113113
if fb.style.WindowBar != "" {
114114
fb.filterComplex.WriteString(";")
115-
fb.filterComplex.WriteString(
116-
fmt.Sprintf(`
115+
_, _ = fmt.Fprintf(
116+
fb.filterComplex,
117+
`
117118
[%d]loop=-1[loopbar];
118119
[loopbar][%s]overlay=0:%d[withbar]
119120
`,
120-
barStream,
121-
fb.prevStageName,
122-
fb.style.WindowBarSize,
123-
),
121+
barStream,
122+
fb.prevStageName,
123+
fb.style.WindowBarSize,
124124
)
125125

126126
fb.prevStageName = "withbar"
@@ -133,14 +133,14 @@ func (fb *FilterComplexBuilder) WithWindowBar(barStream int) *FilterComplexBuild
133133
func (fb *FilterComplexBuilder) WithBorderRadius(cornerMarkStream int) *FilterComplexBuilder {
134134
if fb.style.BorderRadius != 0 {
135135
fb.filterComplex.WriteString(";")
136-
fb.filterComplex.WriteString(
137-
fmt.Sprintf(`
138-
[%d]loop=-1[loopmask];
139-
[%s][loopmask]alphamerge[rounded]
140-
`,
141-
cornerMarkStream,
142-
fb.prevStageName,
143-
),
136+
_, _ = fmt.Fprintf(
137+
fb.filterComplex,
138+
`
139+
[%d]loop=-1[loopmask];
140+
[%s][loopmask]alphamerge[rounded]
141+
`,
142+
cornerMarkStream,
143+
fb.prevStageName,
144144
)
145145
fb.prevStageName = "rounded"
146146
}
@@ -155,16 +155,16 @@ func (fb *FilterComplexBuilder) WithMarginFill(marginStream int) *FilterComplexB
155155
// ffmpeg will complain if the final filter ends with a semicolon,
156156
// so we add one BEFORE we start adding filters.
157157
fb.filterComplex.WriteString(";")
158-
fb.filterComplex.WriteString(
159-
fmt.Sprintf(`
158+
_, _ = fmt.Fprintf(
159+
fb.filterComplex,
160+
`
160161
[%d]scale=%d:%d[bg];
161162
[bg][%s]overlay=(W-w)/2:(H-h)/2:shortest=1[withbg]
162163
`,
163-
marginStream,
164-
fb.style.Width,
165-
fb.style.Height,
166-
fb.prevStageName,
167-
),
164+
marginStream,
165+
fb.style.Width,
166+
fb.style.Height,
167+
fb.prevStageName,
168168
)
169169
fb.prevStageName = "withbg"
170170
}
@@ -175,13 +175,13 @@ func (fb *FilterComplexBuilder) WithMarginFill(marginStream int) *FilterComplexB
175175
// WithGIF adds gif options to ffmepg filter_complex.
176176
func (fb *FilterComplexBuilder) WithGIF() *FilterComplexBuilder {
177177
fb.filterComplex.WriteString(";")
178-
fb.filterComplex.WriteString(
179-
fmt.Sprintf(`
180-
[%s]split[plt_a][plt_b];
181-
[plt_a]palettegen=max_colors=256[plt];
182-
[plt_b][plt]paletteuse[palette]`,
183-
fb.prevStageName,
184-
),
178+
_, _ = fmt.Fprintf(
179+
fb.filterComplex,
180+
`
181+
[%s]split[plt_a][plt_b];
182+
[plt_a]palettegen=max_colors=256[plt];
183+
[plt_b][plt]paletteuse[palette]`,
184+
fb.prevStageName,
185185
)
186186
fb.prevStageName = "palette"
187187

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/charmbracelet/vhs
22

3-
go 1.23.0
4-
5-
toolchain go1.24.1
3+
go 1.24.1
64

75
require (
86
github.com/agnivade/levenshtein v1.2.1

lexer/lexer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package lexer provides a lexer for the VHS Tape language.
12
package lexer
23

34
import "github.com/charmbracelet/vhs/token"

parser/parser.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package parser provides a parser for the VHS Tape language.
12
package parser
23

34
import (

record.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func Record(_ *cobra.Command, _ []string) error {
9494
in := io.MultiWriter(tape, terminal)
9595

9696
if shell != defaultShell {
97-
tape.WriteString(fmt.Sprintf("%s Shell %s\n", token.SET, shell))
97+
_, _ = fmt.Fprintf(tape, "%s Shell %s\n", token.SET, shell)
9898
}
9999

100100
go func() {
@@ -104,7 +104,7 @@ func Record(_ *cobra.Command, _ []string) error {
104104
time.Sleep(sleepThreshold)
105105
if length == tape.Len() {
106106
// Tape has not changed in a while, write a Sleep command.
107-
tape.WriteString(fmt.Sprintf("\n%s\n", token.SLEEP))
107+
_, _ = fmt.Fprintf(tape, "\n%s\n", token.SLEEP)
108108
}
109109
}
110110
}()

0 commit comments

Comments
 (0)