checkstyle

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: MIT Imports: 4 Imported by: 0

README

checkstyle

GoDoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(left, right *Checkstyle, opt DiffOptions) (*Checkstyle, *Checkstyle)

Diff runs a diff operation on two checkstyle structs and returns two new checkstyle structs of fixed and created errors

Types

type Checkstyle

type Checkstyle struct {
	XMLName xml.Name `xml:"checkstyle"`
	Version string   `xml:"version,attr"`
	File    Files    `xml:"file"`
}

Checkstyle <checkstyle /> XML struct as defined by the checkstyle standard

func Decode

func Decode(r io.Reader) (*Checkstyle, error)

Decode reads a checkstyle file from a reader

type DiffOptions

type DiffOptions struct {
	MaxLineDiff int
}

DiffOptions are the options for the Diff command

type File added in v0.3.0

type File struct {
	Name  string      `xml:"name,attr"`
	Error []FileError `xml:"error"`
}

File <file /> XML struct as defined by the checkstyle standard

type FileError added in v0.3.0

type FileError struct {
	Line     int           `xml:"line,attr"`
	Severity SeverityLevel `xml:"severity,attr"`
	Message  string        `xml:"message,attr"`
	Source   string        `xml:"source,attr"`
}

FileError <error /> XML struct as defined by the checkstyle standard

type Files added in v0.3.0

type Files []File

Files is a collection of <file /> XML structs with added helpers

func (Files) FromName added in v0.3.0

func (chk Files) FromName(name string) File

FromName finds a File matching the given filename. If multiple files match a given name their errors will be merged

type SeverityLevel

type SeverityLevel string

SeverityLevel as defined by severity levels from https://checkstyle.sourceforge.io/property_types.html#SeverityLevel

const (
	SeverityIgnore  SeverityLevel = "ignore"
	SeverityInfo    SeverityLevel = "info"
	SeverityWarning SeverityLevel = "warning"
	SeverityError   SeverityLevel = "error"
)

SeverityLevels as defined by the checkstyle standard

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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