linters

package
v0.3.29 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxLengthObject = 30
	MaxSegmentCount = 6
)

Variables

This section is empty.

Functions

func FindIdentsWithPartialPrefix

func FindIdentsWithPartialPrefix(prefixSource string, idents []string) (commonPrefix string, found []string)

func FirstToLower added in v0.3.17

func FirstToLower(s string) string

func FirstToUpper added in v0.3.17

func FirstToUpper(s string) string

func FixName added in v0.3.19

func FixName(text string) string

func FixNameFromFuncDecl added in v0.3.19

func FixNameFromFuncDecl(fn *ast.FuncDecl) string

func ForFuncType

func ForFuncType(n *ast.FuncType) *ast.FieldList

ForFuncType returns TypeParams.

func ForTypeSpec

func ForTypeSpec(n *ast.TypeSpec) *ast.FieldList

ForTypeSpec returns TypeParams.

func GetObjectName

func GetObjectName(node ast.Node) string

func GetSegmentCount

func GetSegmentCount(text string) int

func GetSegments

func GetSegments(ident string) (segments []string)

func IsGeneric

func IsGeneric(node ast.Node, info *types.Info) bool

IsGeneric check code on generic.

func IsLower added in v0.3.17

func IsLower(b byte) bool

func NewNoDefer

func NewNoDefer() *analysis.Linter

NewNoDefer create instance linter for check defer.

func NewNoGeneric

func NewNoGeneric() *analysis.Linter

NewNoGeneric create instance linter for check generic. Please more info in https://cs.opensource.google/go/x/tools/+/master:go/analysis/passes/usesgenerics/

func NewNoGoroutine

func NewNoGoroutine() *analysis.Linter

NewNoGoroutine create instance linter for check goroutines.

func NewNoInit

func NewNoInit() *analysis.Linter

NewNoInit create instance linter for check func init.

func NewNoLength

func NewNoLength() *analysis.Linter

NewNoLength create instance linter for length object.

func NewNoNoLint

func NewNoNoLint() *analysis.Linter

NewNoNoLint create instance linter for check func nolint.

func NewNoPrefix

func NewNoPrefix() *analysis.Linter

NewNoPrefix create instance linter for check func prefix.

func ReadLine

func ReadLine(path string, line int) string

Types

type FuncComment

type FuncComment struct {
	Text     string
	Line     int
	Filename string
	IsDoc    bool
}

func GetCommentsByFunc

func GetCommentsByFunc(fn *ast.FuncDecl, fileComments []*ast.CommentGroup, fset *token.FileSet) []FuncComment

Jump to

Keyboard shortcuts

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