mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-07 02:07:04 +00:00
chore: enable some more linters
This commit is contained in:
parent
f0eed8cc56
commit
63649d4397
7 changed files with 48 additions and 18 deletions
|
|
@ -12,8 +12,10 @@ import (
|
|||
"github.com/apricote/releaser-pleaser/internal/markdown/extensions/ast"
|
||||
)
|
||||
|
||||
var sectionStartRegex = regexp.MustCompile(`^<!-- section-start (.+) -->`)
|
||||
var sectionEndRegex = regexp.MustCompile(`^<!-- section-end (.+) -->`)
|
||||
var (
|
||||
sectionStartRegex = regexp.MustCompile(`^<!-- section-start (.+) -->`)
|
||||
sectionEndRegex = regexp.MustCompile(`^<!-- section-end (.+) -->`)
|
||||
)
|
||||
|
||||
const (
|
||||
sectionTrigger = "<!--"
|
||||
|
|
@ -21,8 +23,7 @@ const (
|
|||
SectionEndFormat = "<!-- section-end %s -->"
|
||||
)
|
||||
|
||||
type sectionParser struct {
|
||||
}
|
||||
type sectionParser struct{}
|
||||
|
||||
func (s *sectionParser) Open(_ gast.Node, reader text.Reader, _ parser.Context) (gast.Node, parser.State) {
|
||||
line, _ := reader.PeekLine()
|
||||
|
|
@ -75,8 +76,7 @@ func (s *sectionParser) Trigger() []byte {
|
|||
return []byte(sectionTrigger)
|
||||
}
|
||||
|
||||
type section struct {
|
||||
}
|
||||
type section struct{}
|
||||
|
||||
// Section is an extension that allow you to use group content under a shared parent ast node.
|
||||
var Section = §ion{}
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ func (r *Renderer) renderFencedCodeBlock(w util.BufWriter, source []byte, node a
|
|||
return ast.WalkStop, fmt.Errorf(": %w", err)
|
||||
}
|
||||
if err := r.writeByte(w, '\n'); err != nil {
|
||||
return ast.WalkStop, nil
|
||||
return ast.WalkStop, fmt.Errorf(": %w", err)
|
||||
}
|
||||
|
||||
// Write the contents of the fenced code block.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue