types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types contains all the custom types we will use in this program.

Index

Constants

View Source
const (
	Err  = 0
	Warn = 1
	Note = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIOptions

type CLIOptions struct {
	// up options
	Files           []string
	ExcludeComments bool
	WError          bool
}

CLIOptions stores options we're passing to cobra's CLI args.

type ParsedTokens

type ParsedTokens struct {
	Arguments   map[string]*syntax.Assign
	Assignments map[string]*syntax.Assign
	Comments    []string
	Iters       map[string]*syntax.WordIter
	Variables   []*syntax.Lit
	Function    *syntax.FuncDecl
}

ParsedTokens will keep the results of all the parsing of the function, and will be then used to apply our rules.

type ReportedVar

type ReportedVar struct {
	Subject  *syntax.Lit
	Function *syntax.FuncDecl
	Reason   string
	Level    int
}

ReportedVar is our message to be displayed.

Subject is what is erroring
Function is the context function where Subject is
Reason is a brief description of the problem
Level is the severity from levels.

func (*ReportedVar) Print

func (v *ReportedVar) Print(filepath string)

Print will pretty print our outputs in a Vim compatible way.

Jump to

Keyboard shortcuts

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