Documentation
¶
Index ¶
- Constants
- Variables
- func Detect(project api.Project) []api.CQLinter
- func DetectLinter(linter api.CQLinter, project api.Project) bool
- func DetectType(typ api.CQLinterType, project api.Project) bool
- func FromConfig(conf config.CodeQualityConfig) ([]api.CQLinter, error)
- type Bandit
- func (p Bandit) DependencyName() string
- func (p Bandit) IsConfigured(project api.Project) bool
- func (p Bandit) IsInstalled() bool
- func (p Bandit) IsProperlyConfigured(project api.Project) bool
- func (p Bandit) Run(project api.Project) ([]api.CQLinterResult, error)
- func (p Bandit) String() string
- func (p Bandit) Type() api.CQLinterType
- type BanditMessage
- type Black
- func (p Black) DependencyName() string
- func (p Black) IsConfigured(project api.Project) bool
- func (p Black) IsInstalled() bool
- func (p Black) IsProperlyConfigured(project api.Project) bool
- func (p Black) Run(project api.Project) ([]api.CQLinterResult, error)
- func (p Black) String() string
- func (p Black) Type() api.CQLinterType
- type ISort
- func (p ISort) DependencyName() string
- func (p ISort) IsConfigured(project api.Project) bool
- func (p ISort) IsInstalled() bool
- func (p ISort) IsProperlyConfigured(project api.Project) bool
- func (p ISort) Run(project api.Project) ([]api.CQLinterResult, error)
- func (p ISort) String() string
- func (p ISort) Type() api.CQLinterType
- type ISortProblem
- type MessageType
- type Mypy
- func (p Mypy) DependencyName() string
- func (p Mypy) IsConfigured(project api.Project) bool
- func (p Mypy) IsInstalled() bool
- func (p Mypy) IsProperlyConfigured(project api.Project) bool
- func (p Mypy) Run(project api.Project) ([]api.CQLinterResult, error)
- func (p Mypy) String() string
- func (p Mypy) Type() api.CQLinterType
- type MypyMessage
- type Pylint
- func (p Pylint) DependencyName() string
- func (p Pylint) IsConfigured(project api.Project) bool
- func (p Pylint) IsInstalled() bool
- func (p Pylint) IsProperlyConfigured(project api.Project) bool
- func (p Pylint) Run(project api.Project) ([]api.CQLinterResult, error)
- func (p Pylint) String() string
- func (p Pylint) Type() api.CQLinterType
- type PylintMessage
Constants ¶
const ( TypePylint api.CQLinterType = "pylint" TypeMypy api.CQLinterType = "mypy" TypeBlack api.CQLinterType = "black" TypeISort api.CQLinterType = "isort" TypeBandit api.CQLinterType = "bandit" )
Variables ¶
var AllTypes = []api.CQLinterType{ TypePylint, TypeMypy, TypeBlack, TypeISort, TypeBandit, }
var ByType = map[api.CQLinterType]api.CQLinter{ TypePylint: Pylint{}, TypeMypy: Mypy{}, TypeBlack: Black{}, TypeISort: ISort{}, TypeBandit: Bandit{}, }
var MessageTypes = []string{ string(TypeConvention), string(TypeRefactor), string(TypeWarning), string(TypeError), string(TypeFatal), }
MessageTypes is the list of all message types emitted by Pylint, but then as strings for easy appending to a string array.
var Symbols = []string{}/* 282 elements not displayed */
Symbols is a list of all 282 linting warnings / errors / messages that Pylint emits in its default configuration. To regenerate this list, use `pylint --list-msgs-enabled`, then copy the enabled messages and use `cut -d " " -f1` to cut off the symbol ID.
Functions ¶
func DetectLinter ¶
DetectLinter returns true if this is CQLinter is being used in the project, i.e. when either linter.IsConfigured() is true, or when the project's main dependency manager has the linter in its dependencies.
func DetectType ¶
func DetectType(typ api.CQLinterType, project api.Project) bool
DetectType returns true if this CQLinterType is being used in the project.
func FromConfig ¶
func FromConfig(conf config.CodeQualityConfig) ([]api.CQLinter, error)
FromConfig returns a list of CQLinters based on the CodeQualityConfig from the mllint configuration. Always returns a non-nil list of CQLinters containing all correctly named linters, even when there is an error.
Types ¶
type Bandit ¶
type Bandit struct{}
func (Bandit) DependencyName ¶
func (Bandit) IsInstalled ¶
func (Bandit) Type ¶
func (p Bandit) Type() api.CQLinterType
type BanditMessage ¶
type BanditMessage struct { TestID string `yaml:"test_id"` TestName string `yaml:"test_name"` Confidence string `yaml:"issue_confidence"` Severity string `yaml:"issue_severity"` Text string `yaml:"issue_text"` MoreInfo string `yaml:"more_info"` CodeSnippet string `yaml:"code"` Filename string `yaml:"filename"` Line int32 `yaml:"line_number"` }
func (BanditMessage) String ¶
func (msg BanditMessage) String() string
type Black ¶
type Black struct{}
func (Black) DependencyName ¶
func (Black) IsInstalled ¶
func (Black) Type ¶
func (p Black) Type() api.CQLinterType
type ISort ¶
type ISort struct{}
func (ISort) DependencyName ¶
func (ISort) IsInstalled ¶
func (ISort) Type ¶
func (p ISort) Type() api.CQLinterType
type ISortProblem ¶
func (ISortProblem) String ¶
func (msg ISortProblem) String() string
type MessageType ¶
type MessageType string
MessageType is the type of Pylint message that is emitted See: https://code.visualstudio.com/docs/python/linting#_pylint
const ( // TypeConvention indicates a programming standard violation, i.e. stylistic issue. TypeConvention MessageType = "convention" // TypeRefactor indicates a bad code smell TypeRefactor MessageType = "refactor" // TypeWarning can include various Python-specific warnings TypeWarning MessageType = "warning" // TypeError is for "likely code bugs" that will probably definitely give bugs TypeError MessageType = "error" // TypeFatal is for errors preventing further Pylint processing. TypeFatal MessageType = "fatal" )
type Mypy ¶
type Mypy struct{}
func (Mypy) DependencyName ¶
func (Mypy) IsInstalled ¶
func (Mypy) Type ¶
func (p Mypy) Type() api.CQLinterType
type MypyMessage ¶
func (MypyMessage) String ¶
func (msg MypyMessage) String() string
type Pylint ¶
type Pylint struct{}
func (Pylint) DependencyName ¶
func (Pylint) IsInstalled ¶
func (Pylint) Type ¶
func (p Pylint) Type() api.CQLinterType
type PylintMessage ¶
type PylintMessage struct { Type MessageType `json:"type" yaml:"type"` Symbol string `json:"symbol" yaml:"symbol"` Message string `json:"message" yaml:"message"` MessageID string `json:"message-id" yaml:"symbolId"` Path string `json:"path" yaml:"path"` Line int32 `json:"line" yaml:"line"` Column int16 `json:"column" yaml:"column"` }
PylintMessage represents a Pylint error / warning message (in JSON)
func (PylintMessage) String ¶
func (msg PylintMessage) String() string