whitespace

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 2 Imported by: 0

README

Whitespace linter

Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc.

Installation guide

Whitespace is included in golangci-lint. Install it and enable whitespace.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Pos     token.Position
	Type    MessageType
	Message string
}

Message contains a message

func Run

func Run(file *ast.File, fset *token.FileSet, settings Settings) []Message

Run runs this linter on the provided code

type MessageType added in v0.0.3

type MessageType uint8

MessageType describes what should happen to fix the warning

const (
	MessageTypeLeading MessageType = iota + 1
	MessageTypeTrailing
	MessageTypeAddAfter
)

List of MessageTypes

type Settings added in v0.0.3

type Settings struct {
	MultiIf   bool
	MultiFunc bool
}

Settings contains settings for edge-cases

Jump to

Keyboard shortcuts

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