mypy

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RuleNoIssues = api.Rule{
	Slug: "code-quality/mypy/no-issues",
	Name: "Mypy reports no issues with this project",
	Details: fmt.Sprintf(`> [Mypy](http://mypy-lang.org/) is an optional static type checker for Python that aims to combine the benefits of dynamic (or "duck") typing and static typing. Mypy combines the expressive power and convenience of Python with a powerful type system and compile-time type checking.

This rule checks whether Mypy finds any type issues when running it on all Python files in this project.

Per default, mllint is configured to make Mypy enforce static typing.

The score for this rule is determined as a function of the number of messages Mypy returns and the lines of Python code that your project has.
In the ideal case, Mypy does not recognise any code smells in your project, in which case the score is 100%%.
When there is one Mypy issue for every 20 lines of code, then the score is 50%%.
When there is one Mypy issue for every 10 lines of code, then the score is 0%%.

More specifically, in pseudocode, %s. Note that the measured amount of lines of code includes any non-hidden Python files in the repository, including those that are ignored by Mypy.

To learn more about how type-checking works and how to use it in Python, see:
- https://realpython.com/python-type-checking/
`,
		"`score = 100 - 100 * min(1, 10 * number of msgs / lines of code)`"),
	Weight: 1,
}

Functions

func NewLinter

func NewLinter() api.Linter

Types

type MypyLinter

type MypyLinter struct{}

func (*MypyLinter) LintProject

func (l *MypyLinter) LintProject(project api.Project) (api.Report, error)

func (*MypyLinter) Name

func (l *MypyLinter) Name() string

func (*MypyLinter) Rules

func (l *MypyLinter) Rules() []*api.Rule

Jump to

Keyboard shortcuts

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