1
0
mirror of https://github.com/go-task/task.git synced 2025-06-25 00:47:04 +02:00

chore: add linter mirror (#2060)

This commit is contained in:
Oleksandr Redko
2025-02-24 14:06:54 +02:00
committed by GitHub
parent fb631902ce
commit a266fba93e
3 changed files with 5 additions and 4 deletions

View File

@ -9,6 +9,7 @@ linters:
- goimports - goimports
- gofmt - gofmt
- gofumpt - gofumpt
- mirror
- misspell - misspell
- noctx - noctx
- paralleltest - paralleltest

View File

@ -772,7 +772,7 @@ func TestPromptInSummary(t *testing.T) {
var outBuff bytes.Buffer var outBuff bytes.Buffer
var errBuff bytes.Buffer var errBuff bytes.Buffer
inBuff.Write([]byte(test.input)) inBuff.WriteString(test.input)
e := task.Executor{ e := task.Executor{
Dir: dir, Dir: dir,
@ -802,7 +802,7 @@ func TestPromptWithIndirectTask(t *testing.T) {
var outBuff bytes.Buffer var outBuff bytes.Buffer
var errBuff bytes.Buffer var errBuff bytes.Buffer
inBuff.Write([]byte("y\n")) inBuff.WriteString("y\n")
e := task.Executor{ e := task.Executor{
Dir: dir, Dir: dir,
@ -839,7 +839,7 @@ func TestPromptAssumeYes(t *testing.T) {
var errBuff bytes.Buffer var errBuff bytes.Buffer
// always cancel the prompt so we can require.Error // always cancel the prompt so we can require.Error
inBuff.Write([]byte("\n")) inBuff.WriteByte('\n')
e := task.Executor{ e := task.Executor{
Dir: dir, Dir: dir,

View File

@ -59,7 +59,7 @@ func NewSnippet(b []byte, opts ...SnippetOption) *Snippet {
// Syntax highlight the input and split it into lines // Syntax highlight the input and split it into lines
buf := &bytes.Buffer{} buf := &bytes.Buffer{}
if err := quick.Highlight(buf, string(b), "yaml", "terminal", "task"); err != nil { if err := quick.Highlight(buf, string(b), "yaml", "terminal", "task"); err != nil {
buf.WriteString(string(b)) buf.Write(b)
} }
linesRaw := strings.Split(string(b), "\n") linesRaw := strings.Split(string(b), "\n")
linesHighlighted := strings.Split(buf.String(), "\n") linesHighlighted := strings.Split(buf.String(), "\n")