linter

package
v0.0.0-...-5f60744 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package linter implements a Dockerfile linter

Index

Constants

View Source
const (
	DockerfileTargetType = "dockerfile"
	ImageTargetType      = "image"
)
View Source
const (
	StatusUnknown  = "unknown"
	StatusRunning  = "running"
	StatusComplete = "complete"
	StatusTimedOut = "timeout"
	StatusFailed   = "failed"
)

Variables

View Source
var (
	ErrBadParams = errors.New("bad params")
)

Functions

func ListChecks

func ListChecks() []*check.Info

Types

type CheckContext

type CheckContext struct {
	DockerfilePath  string
	Dockerfile      *spec.Dockerfile
	BuildContextDir string
	Dockerignore    *dockerignore.Matcher
}

type CheckSelector

type CheckSelector struct {
	IncludeCheckLabels map[string]string
	IncludeCheckIDs    map[string]struct{}
	ExcludeCheckLabels map[string]string
	ExcludeCheckIDs    map[string]struct{}
}

type CheckState

type CheckState struct {
	Check   check.Runner
	Options *check.Options
	Context *check.Context
	Result  *check.Result
	Error   error
}

type Options

type Options struct {
	DockerfilePath   string
	Dockerfile       *spec.Dockerfile
	SkipBuildContext bool
	BuildContextDir  string
	SkipDockerignore bool //to disable .dockerignore parsing
	Dockerignore     *dockerignore.Matcher
	Selector         CheckSelector
	Config           map[string]*check.Options
}

type Report

type Report struct {
	Status          string
	BuildContextDir string
	Dockerfile      *spec.Dockerfile
	Dockerignore    *dockerignore.Matcher
	Hits            map[string]*check.Result
	NoHits          map[string]*check.Result
	Errors          map[string]error
}

TODO: add report name, report time, etc

func Execute

func Execute(options Options) (*Report, error)

func NewReport

func NewReport() *Report

Directories

Path Synopsis
Package check contains the linter checks
Package check contains the linter checks

Jump to

Keyboard shortcuts

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