lint

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUrl

func IsUrl(str string) bool

Types

type LinkLint

type LinkLint struct {
	Path     string
	Line     string
	Position Position
	Message  string
	Status   string
}

type LinkLintConfig

type LinkLintConfig struct {
	IncludeExts       []string              `yaml:"includeExts"`
	ExcludeLinks      []string              `yaml:"excludeLinks"`
	ExcludePaths      []string              `yaml:"excludePaths"`
	AcceptStatusCodes []int                 `yaml:"acceptStatusCodes"`
	LinkMap           map[string][]LinkLint // consists map as the key and file details as values
}

func New

func New(configFile string) (*LinkLintConfig, error)

func NewFromContent

func NewFromContent(content []byte) (*LinkLintConfig, error)

func (*LinkLintConfig) Init

func (llc *LinkLintConfig) Init(dir string) error

func (*LinkLintConfig) LintAll

func (llc *LinkLintConfig) LintAll() bool

func (*LinkLintConfig) OnFail

func (llc *LinkLintConfig) OnFail(message, link string)

func (*LinkLintConfig) OnPass

func (llc *LinkLintConfig) OnPass(message, link string)

func (*LinkLintConfig) ReadFile

func (llc *LinkLintConfig) ReadFile(path string) error

func (*LinkLintConfig) ShowFailSummary

func (llc *LinkLintConfig) ShowFailSummary()

func (*LinkLintConfig) ShowPassSummary

func (llc *LinkLintConfig) ShowPassSummary()

func (*LinkLintConfig) ShowSummary

func (llc *LinkLintConfig) ShowSummary()

type Position

type Position struct {
	Row, Col int
}

Jump to

Keyboard shortcuts

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