lints

command
v3.0.0-...-cfbdf18 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

Linting the Linter

This directory contains a collection of Golang code linters that are intended to be very specific to ZLint itself.

Running

go run main.go <path to code directory>

The linter will walk the given directory recursively and attempt to parse and lint each Go file it comes accross.

In order to extend this custom linter, write a new Go file in the lints directory which contains a struct that implements the following interface.

Extending

type Lint interface {
    Lint(tree *ast.File, file *File) *Result
    CheckApplies(tree *ast.File, file *File) bool
}

Then go in to main.go and add a pointer to your lint to the Linters slice.

var Linters = []lint.Lint{
    &lints.InitFirst{},
    &lints.MySuperCoolLint{}
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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