fencedcodestyle

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FenceCharAt added in v0.4.0

func FenceCharAt(src []byte, pos int) byte

FenceCharAt returns the fence character at the given position, skipping leading spaces.

func FenceCloseLine

func FenceCloseLine(f *lint.File, fcb *ast.FencedCodeBlock) int

FenceCloseLine returns the 1-based line number of the closing fence.

func FenceCloseLineRange

func FenceCloseLineRange(src []byte, fcb *ast.FencedCodeBlock, openEnd int) (int, int)

FenceCloseLineRange is an exported wrapper for tests.

func FenceLines

func FenceLines(src []byte, fcb *ast.FencedCodeBlock) (openStart, openEnd, closeStart, closeEnd int)

FenceLines returns a helper for getting the line ranges used by other rules.

func FenceOpenLine

func FenceOpenLine(f *lint.File, fcb *ast.FencedCodeBlock) int

FenceOpenLine returns the 1-based line number of the opening fence.

func FenceOpenLineRange

func FenceOpenLineRange(src []byte, fcb *ast.FencedCodeBlock) (int, int)

FenceOpenLineRange is an exported wrapper for tests.

Types

type Rule

type Rule struct {
	Style string // "backtick" or "tilde"
}

Rule checks that fenced code blocks use a consistent fence style. Default style is "backtick". Set Style to "tilde" for tilde fences.

func (*Rule) ApplySettings

func (r *Rule) ApplySettings(settings map[string]any) error

ApplySettings implements rule.Configurable.

func (*Rule) Category

func (r *Rule) Category() string

Category implements rule.Rule.

func (*Rule) Check

func (r *Rule) Check(f *lint.File) []lint.Diagnostic

Check implements rule.Rule.

func (*Rule) DefaultSettings

func (r *Rule) DefaultSettings() map[string]any

DefaultSettings implements rule.Configurable.

func (*Rule) Fix

func (r *Rule) Fix(f *lint.File) []byte

Fix implements rule.FixableRule.

func (*Rule) ID

func (r *Rule) ID() string

ID implements rule.Rule.

func (*Rule) Name

func (r *Rule) Name() string

Name implements rule.Rule.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL