godot

package module
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 4 Imported by: 11

README

godot

License Github CI Go Report Codecov

Linter that checks if all top-level comments contain a period at the end of the last sentence if needed.

CodeReviewComments quote:

Comments should begin with the name of the thing being described and end in a period

Install and run

NOTE: Godot is available as a part of GolangCI Lint (disabled by default).

Build from source

go get -u github.com/tetafro/godot/cmd/godot

or download binary from releases page.

Run

godot ./myproject

Examples

Code

package math

// Sum sums two integers
func Sum(a, b int) int {
    return a + b // result
}

Output

Top level comment should end in a period: math/math.go:3:1

See more examples in test files:

Documentation

Overview

Package godot checks if all top-level comments contain a period at the end of the last sentence if needed.

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 of linting error.

func Run

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

Run runs this linter on the provided code.

type Settings added in v0.2.4

type Settings struct {
	// Check all top-level comments, not only declarations
	CheckAll bool
}

Settings contains linter settings.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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