whitespace

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 2 Imported by: 19

README

Whitespace linter

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

Example code:

package main

import "fmt"

func main() {

	fmt.Println("Hello world")
}

Reults in:

$ whitespace .
main.go:6:unnecessary newline

Installation guide

go get git.ultraware.nl/NiseVoid/whitespace
Gometalinter

You can add whitespace to gometalinter and enable it.

.gometalinter.json:

{
	"Linters": {
		"whitespace": "whitespace:PATH:LINE:MESSAGE"
	},

	"Enable": [
		"whitespace"
	]
}

commandline:

gometalinter --linter "whitespace:whitespace:PATH:LINE:MESSAGE" --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
	Message string
}

Message contains a message

func Run

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

Run runs this linter on the provided code

Jump to

Keyboard shortcuts

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