ccheck

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCheckApplication

type CCheckApplication struct {
	// contains filtered or unexported fields
}

func NewCCheckApplication

func NewCCheckApplication(path string, afs *afero.Afero) (*CCheckApplication, error)

func (*CCheckApplication) Execute

func (app *CCheckApplication) Execute(config *CCheckConfig) error

type CCheckConfig

type CCheckConfig struct {
	// contains filtered or unexported fields
}

func NewCCheckConfig

func NewCCheckConfig(buffer []byte, format string) *CCheckConfig

type CCheckFile

type CCheckFile struct {
	// contains filtered or unexported fields
}

func GetFiles

func GetFiles(path string, afs *afero.Afero) ([]CCheckFile, error)

func NewCCheckFile

func NewCCheckFile(path string, afs *afero.Afero) *CCheckFile

type CCheckIgnore

type CCheckIgnore struct {
	// contains filtered or unexported fields
}

func NewCCheckIgnore

func NewCCheckIgnore(path string, afs *afero.Afero) (*CCheckIgnore, error)

Creates a new CCheckIgnore struct.

func (*CCheckIgnore) Contains

func (ignore *CCheckIgnore) Contains(path string) (bool, error)

Contains returns true if an Ignore struct contains a pattern matching the provided path.

type CCheckIgnorePattern

type CCheckIgnorePattern struct {
	IsNegation bool
	Value      string
}

func NewCCheckIgnorePattern

func NewCCheckIgnorePattern(value string) (*CCheckIgnorePattern, error)

Creates a new CCheckIgnorePattern struct.

If the value begins with a '!', the IsNegation flag is set to true and the character is removed.

func ParsePatterns

func ParsePatterns(filepath string, afs *afero.Afero) ([]CCheckIgnorePattern, error)

ParsePatterns reads patterns from a filepath.

func (*CCheckIgnorePattern) IsBlank

func (pattern *CCheckIgnorePattern) IsBlank() bool

IsBlank returns true if the pattern contains only whitespace.

A pattern that contains only whitespace is ignored.

func (*CCheckIgnorePattern) IsComment

func (pattern *CCheckIgnorePattern) IsComment() bool

IsComment returns true if the pattern beings with a '#'.

A pattern that is a comment is ignored. A pattern that needs to evaulate against paths that being with a literal '#' must escape the character using a backslash.

Example:

IsComment("#") 	(true)
IsComment("\#") (false)

type CCheckLinter

type CCheckLinter struct {
	// contains filtered or unexported fields
}

func NewCCheckLinter

func NewCCheckLinter(scanner *CCheckScanner, ignore *CCheckIgnore) *CCheckLinter

func (*CCheckLinter) Lint

func (linter *CCheckLinter) Lint(validations []CCheckValidation) error

type CCheckScanner

type CCheckScanner struct {
	// contains filtered or unexported fields
}

func NewCCheckScanner

func NewCCheckScanner(path string, afs *afero.Afero) (*CCheckScanner, error)

func (*CCheckScanner) HasNext

func (scanner *CCheckScanner) HasNext() bool

func (*CCheckScanner) Next

func (scanner *CCheckScanner) Next() *CCheckFile

type CCheckValidation

type CCheckValidation interface {
	Evaluate(file *CCheckFile) (*CCheckValidationReport, error)
}

type CCheckValidationC000

type CCheckValidationC000 struct {
	// contains filtered or unexported fields
}

func NewCCheckValidationC000

func NewCCheckValidationC000(copyright *copyrights.CCheckCopyright) *CCheckValidationC000

func (*CCheckValidationC000) Evaluate

func (validation *CCheckValidationC000) Evaluate(file *CCheckFile) (*CCheckValidationReport, error)

type CCheckValidationReport

type CCheckValidationReport struct {
	Code            string
	HasError        bool
	Path            string
	LineNumberStart int
	LineNumberEnd   int
	Error           error
}

func (*CCheckValidationReport) String

func (report *CCheckValidationReport) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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