plugin

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PluginRoot = "~/.tflint.d/plugins"

PluginRoot is the root directory of the plugins This variable is exposed for testing.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	Name    string
	Version string
	Rules   []Rule
}

Plugin is a mechanism for adding third-party rules. Each plugin must be built with `--buildmode=plugin`. @see https://golang.org/pkg/plugin/

Each plugin must have a top-level function named `Name`, `Version` and `NewRules`. The return value of NewRules must be a structure that satisfies the Rule interface.

func Find

func Find(c *tflint.Config) ([]*Plugin, error)

Find searches and returns plugins that meet the naming convention. All plugins must be placed under `~/.tflint.d/plugins` and these must be named `tflint-ruleset-*.so`.

func OpenPlugin

func OpenPlugin(path string) (*Plugin, error)

OpenPlugin looks up symbol from plugins and intiialize Plugin with functions.

type Rule

type Rule interface {
	Name() string
	Enabled() bool
	Severity() string
	Link() string
	Check(runner *tflint.Runner) error
}

Rule is an interface that each plugin should implement.

func NewRules

func NewRules(c *tflint.Config) ([]Rule, error)

NewRules returns all available plugin rules.

Directories

Path Synopsis
test-fixtures

Jump to

Keyboard shortcuts

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