Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FailedResultError ¶ added in v1.0.0
type FailedResultError struct {
// contains filtered or unexported fields
}
FailedResultError means a linter didn't error but returned a failed result
func (*FailedResultError) Error ¶ added in v1.0.0
func (e *FailedResultError) Error() string
Error implements the error interface
type Linter ¶
type Linter interface {
Name() string
Setup(ctx context.Context) error
Cleanup(ctx context.Context) error
Run(filePath string) Report
}
Linter is a simple interface to enable a setup and check using WillRun before executing multiple Run's it is expected that Setup and Cleanup will be called exactly once given a context. It is up to the implementation to pass a context to the Run method if needed and to cancel from the cleanup.
type Reporter ¶ added in v1.0.6
Reporter is used to report results to the user
func NewStandardReporter ¶ added in v1.0.6
NewStandardReporter creates a new StandardReporter
func NewStructuredReporter ¶ added in v1.0.6
NewStructuredReporter creates a new StructuredReporter
type StandardReporter ¶ added in v1.0.6
type StandardReporter struct {
ShowPass bool
SrcOut logFormat
SrcErr logFormat
SrcInt logFormat
Folder folding.Folder
}
StandardReporter is a Reporter that uses simple logging
func (*StandardReporter) Log ¶ added in v1.0.6
func (r *StandardReporter) Log(rep *Report) error
Log simple takes all fields and pushes them to our using the default logFormat
type StructuredReporter ¶ added in v1.0.6
type StructuredReporter struct {
ShowPass bool
SrcOut *log.Entry
SrcErr *log.Entry
SrcInt *log.Entry
}
StructuredReporter is a Reporter that uses structured logging
func (*StructuredReporter) Log ¶ added in v1.0.6
func (r *StructuredReporter) Log(rep *Report) error
Log simple takes all fields and pushes them to our using the default logFormat
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cli allows a CLI tool to be linted from the host or in a container
|
Package cli allows a CLI tool to be linted from the host or in a container |
|
executor
Package exec allows for a CLI tool to be executed in different contexts
|
Package exec allows for a CLI tool to be executed in different contexts |