ast

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileToCoverageItems

func FileToCoverageItems(logger hclog.Logger, file string) ([]*proto.CoverageItem, error)

FileToCoverageItems is the logic of the plugin. it converts file to CoverageItems.

func IsHeader

func IsHeader(fset *token.FileSet, cg *ast.CommentGroup, b *proto.Block) bool

IsHeader returns true if the given *ast.CommentGroup is belonged to the given *proto.Block as HeaderComments.

func IsInline

func IsInline(fset *token.FileSet, cg *ast.CommentGroup, b *proto.Block) bool

IsInline returns true if the given *ast.CommentGroup is belonged to the given *proto.Block as InlineComments.

func IsOnlyNoLintAnnotation added in v0.0.3

func IsOnlyNoLintAnnotation(str string) bool

func Normalize added in v0.0.3

func Normalize(str string) string

Normalize the given comment text.

func ProcessFileCoverage

func ProcessFileCoverage(file string, fset *token.FileSet, f *ast.File) []*proto.CoverageItem

ProcessFileCoverage measures the comment coverage for the entire given file.

func ProcessFunctionCoverage

func ProcessFunctionCoverage(file string, fset *token.FileSet, f *ast.File, fdecl *ast.FuncDecl) *proto.CoverageItem

ProcessFunctionCoverage measures the comment coverage of functions.

func ProcessPackageCoverage

func ProcessPackageCoverage(file string, fset *token.FileSet, f *ast.File) *proto.CoverageItem

ProcessPackageCoverage measures the package level comment coverage.

func ProcessTypeCoverage

func ProcessTypeCoverage(file string, fset *token.FileSet, f *ast.File, gdecl *ast.GenDecl) []*proto.CoverageItem

ProcessTypeCoverage measures the comment coverage of type declarations.

func ProcessVariableCoverage

func ProcessVariableCoverage(file string, fset *token.FileSet, f *ast.File, gdecl *ast.GenDecl) []*proto.CoverageItem

ProcessVariableCoverage measures the comment coverage of variables.

Types

This section is empty.

Jump to

Keyboard shortcuts

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