https://github.com/tetafro/godot
Linter that checks that comments end in a period
https://github.com/tetafro/godot
go golang linter
Last synced: 3 months ago
JSON representation
Linter that checks that comments end in a period
- Host: GitHub
- URL: https://github.com/tetafro/godot
- Owner: tetafro
- License: mit
- Created: 2020-03-15T08:47:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-15T15:01:57.000Z (5 months ago)
- Last Synced: 2025-04-01T05:37:16.636Z (3 months ago)
- Topics: go, golang, linter
- Language: Go
- Homepage:
- Size: 189 KB
- Stars: 46
- Watchers: 4
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# godot
[](https://raw.githubusercontent.com/tetafro/godot/master/LICENSE)
[](https://github.com/tetafro/godot/actions)
[](https://goreportcard.com/report/github.com/tetafro/godot)
[](https://codecov.io/gh/tetafro/godot)Linter that checks if all top-level comments contain a period at the
end of the last sentence if needed.[CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences) 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](https://github.com/golangci/golangci-lint)
(disabled by default).*Build from source
```sh
go install github.com/tetafro/godot/cmd/godot@latest
```or download binary from [releases page](https://github.com/tetafro/godot/releases).
## 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:```yaml
# Which comments to check:
# declarations - for top level declaration comments (default);
# toplevel - for top level comments;
# noinline - for all except inline 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
```sh
godot ./myproject
```Autofix flags are also available
```sh
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
```go
package math// Sum sums two integers
func Sum(a, b int) int {
return a + b // result
}
```Output
```sh
Comment should end in a period: math/math.go:3:1
```