rules

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package rules provides the rules for the linter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MissingReturn

type MissingReturn struct {
	// contains filtered or unexported fields
}

MissingReturn checks for functions that don't return values when they should.

func NewMissingReturn

func NewMissingReturn(reporter *reporter.Reporter) *MissingReturn

NewMissingReturn creates a new missing return rule.

func (*MissingReturn) Analyze

func (r *MissingReturn) Analyze(node ast.ExprNode)

Analyze analyzes the AST for missing return statements.

func (*MissingReturn) Description

func (r *MissingReturn) Description() string

Description returns the description of the rule.

func (*MissingReturn) Name

func (r *MissingReturn) Name() string

Name returns the name of the rule.

type UnreachableCode

type UnreachableCode struct {
	// contains filtered or unexported fields
}

UnreachableCode checks for unreachable code after return statements.

func NewUnreachableCode

func NewUnreachableCode(reporter *reporter.Reporter) *UnreachableCode

NewUnreachableCode creates a new unreachable code rule.

func (*UnreachableCode) Analyze

func (r *UnreachableCode) Analyze(node ast.ExprNode)

Analyze analyzes the AST for unreachable code.

func (*UnreachableCode) Description

func (r *UnreachableCode) Description() string

Description returns the description of the rule.

func (*UnreachableCode) Name

func (r *UnreachableCode) Name() string

Name returns the name of the rule.

type UnusedVariables

type UnusedVariables struct {
	// contains filtered or unexported fields
}

UnusedVariables checks for unused variable declarations.

func NewUnusedVariables

func NewUnusedVariables(reporter *reporter.Reporter) *UnusedVariables

NewUnusedVariables creates a new unused variables rule.

func (*UnusedVariables) Analyze

func (r *UnusedVariables) Analyze(node ast.ExprNode)

Analyze analyzes the AST for unused variables.

func (*UnusedVariables) Description

func (r *UnusedVariables) Description() string

Description returns the description of the rule.

func (*UnusedVariables) Name

func (r *UnusedVariables) Name() string

Name returns the name of the rule.

Jump to

Keyboard shortcuts

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