woodpecker/vendor/github.com/tetafro/godot
2021-11-16 21:07:53 +01:00
..
.gitignore Add linter bidichk to prevent malicios utf8 chars (#516) 2021-11-16 21:07:53 +01:00
.godot.yaml Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00
.golangci.yml Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00
.goreleaser.yml Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00
checks.go Add linter bidichk to prevent malicios utf8 chars (#516) 2021-11-16 21:07:53 +01:00
getters.go Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00
go.mod Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00
go.sum Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00
godot.go Add linter bidichk to prevent malicios utf8 chars (#516) 2021-11-16 21:07:53 +01:00
LICENSE Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00
Makefile Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00
README.md Add linter bidichk to prevent malicios utf8 chars (#516) 2021-11-16 21:07:53 +01:00
settings.go Add golangci-lint (#502) 2021-11-14 21:01:54 +01:00

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

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.

Config

You can specify options using config file. Use default name .godot.yaml, or set it using -c filename.yaml argument. If no config provided the following defaults are used:

# Which comments to check:
#   declarations - for top level declaration comments (default);
#   toplevel     - for top level comments;
#   all          - for all comments.
scope: declarations

# List of regexps for excluding particular comment lines from check.
exclude:

# Check periods at the end of sentences.
period: true

# Check that first letter of each sentence is capital.
capital: false

Run

godot ./myproject

Autofix flags are also available

godot -f ./myproject # fix issues and print the result
godot -w ./myproject # fix issues and replace the original file

See all flags with godot -h.

Example

Code

package math

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

Output

Comment should end in a period: math/math.go:3:1