Help us shape the future of Go! Take the 2026 Go Developer Survey

lint

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInclude added in v0.5.0

func SetInclude(path string)

SetInclude names a file to run against the name registry before any file is checked, which is what lets the linter see an application rather than one file of it.

Without it every check runs against the standard library alone: a class composer autoloads and a helper bootstrap.php registers are both unknown, so the findings are mostly false and a true one cannot be told from them. With `--include vendor/autoload.php` the autoloader is registered and the classmap is what a name resolves against.

It must be called before the first File(), which is what the command does: the registry is built once per process, because registration is deterministic and nothing executes against it afterwards.

Types

type Diagnostic

type Diagnostic struct {
	File    string
	Line    int
	Message string

	// Fatal marks a finding the program cannot survive, as against one it
	// might: a call to a function some host registers is a warning because the
	// linter cannot see every binding, but a redeclaration is refused by the
	// runtime whatever is registered. A fatal finding fails the lint run.
	Fatal bool
}

Diagnostic is one lint finding.

func File

func File(name, src string) ([]Diagnostic, error)

File parses and lints one PHP source file.

func FlatstackFile added in v0.2.1

func FlatstackFile(name, src string) (Diagnostic, error)

FlatstackFile checks whether a single PHP source file is compatible with flatstack engine.

func FlatstackPaths added in v0.2.1

func FlatstackPaths(paths []string) ([]Diagnostic, error)

FlatstackPaths checks flatstack compatibility for all files matched by paths.

func Paths

func Paths(paths []string) ([]Diagnostic, error)

Paths lints each file selected by the provided Go-style path patterns.

func (Diagnostic) String

func (d Diagnostic) String() string

Jump to

Keyboard shortcuts

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