fixers

package
v0.0.0-...-19c4d80 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FixersMap map[string]FixerCreateFunc

Functions

func AddFixer

func AddFixer(name string, createFunc FixerCreateFunc)

func AstToContent

func AstToContent(fset *token.FileSet, node interface{}) string

func ContentToAst

func ContentToAst(content string) (*token.FileSet, *ast.File, error)

Types

type AlternativeCallCsFixer

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

func (*AlternativeCallCsFixer) Fix

func (l *AlternativeCallCsFixer) Fix(content string) (string, error)

func (*AlternativeCallCsFixer) Lint

func (l *AlternativeCallCsFixer) Lint(content string) (Problems, error)

func (*AlternativeCallCsFixer) String

func (l *AlternativeCallCsFixer) String() string

type CsFixer

type CsFixer interface {
}

func CreateFixer

func CreateFixer(name string, options FixerOptions) (CsFixer, error)

type FileHeaderCsFixer

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

func (*FileHeaderCsFixer) Fix

func (l *FileHeaderCsFixer) Fix(content string) (string, error)

func (*FileHeaderCsFixer) Lint

func (l *FileHeaderCsFixer) Lint(content string) (Problems, error)

func (*FileHeaderCsFixer) String

func (l *FileHeaderCsFixer) String() string

type Fixer

type Fixer interface {
	Fix(content string) (string, error)
}

type FixerCreateFunc

type FixerCreateFunc func(options FixerOptions) (CsFixer, error)

type FixerOptions

type FixerOptions map[interface{}]interface{}

type GroupImportFixer

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

func (*GroupImportFixer) Fix

func (l *GroupImportFixer) Fix(content string) (string, error)

func (*GroupImportFixer) Lint

func (l *GroupImportFixer) Lint(content string) (Problems, error)

func (*GroupImportFixer) String

func (l *GroupImportFixer) String() string

type Linter

type Linter interface {
	Lint(content string) (Problems, error)
}

type NoNewLineBeforeErrorCsFixer

type NoNewLineBeforeErrorCsFixer struct {
}

func (*NoNewLineBeforeErrorCsFixer) Fix

func (l *NoNewLineBeforeErrorCsFixer) Fix(content string) (string, error)

func (*NoNewLineBeforeErrorCsFixer) Lint

func (l *NoNewLineBeforeErrorCsFixer) Lint(content string) (Problems, error)

func (*NoNewLineBeforeErrorCsFixer) String

func (l *NoNewLineBeforeErrorCsFixer) String() string

type Position

type Position struct {
	Line int
}

func NewPosition

func NewPosition(line int) *Position

type Problem

type Problem struct {
	Position *Position
	Text     string
	LineText string
}

func (*Problem) String

func (p *Problem) String() string

type Problems

type Problems []*Problem

type UsePathJoinCsFixer

type UsePathJoinCsFixer struct {
}

func (*UsePathJoinCsFixer) Fix

func (l *UsePathJoinCsFixer) Fix(content string) (string, error)

func (*UsePathJoinCsFixer) Lint

func (l *UsePathJoinCsFixer) Lint(content string) (Problems, error)

func (*UsePathJoinCsFixer) String

func (l *UsePathJoinCsFixer) String() string

Jump to

Keyboard shortcuts

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