Categorygithub.com/MartinKuzma/gostutter
module
1.0.1
Repository: https://github.com/martinkuzma/gostutter.git
Documentation: pkg.go.dev

# README

gostutter

Simple linter for golang for stuttering detection (repeating of names) in code.

Package nameCodeRelaxed modeStrict mode
foofunc NewFoo() *FooAllowedForbidden
foofunc HandleFoo()AllowedForbidden
footype ConfigFoo structAllowedForbidden
foofunc fooHandle()ForbiddenForbidden
footype FooConfig structForbiddenForbidden
-type Config struct { config int }ForbiddenForbidden

How to install

go install github.com/MartinKuzma/gostutter@latest

How to run:

gostutter ./...

Output:

pkg/stutter/analyzer.go:54:6: function name "runStutterCheck"  contains name of package "stutter"
pkg/stutter/analyzer.go:78:19: function name "checkStutter"  contains name of package "stutter"
pkg/stutter/analyzer.go:172:6: function name "stutteringDemo"  contains name of package "stutter"
pkg/stutter/analyzer.go:176:6: type name "Stutter" contains name of package "stutter"
pkg/stutter/analyzer.go:177:2: field name "stutter" contains name of structure "Stutter"

Strict mode

GoStutter has strict feature that checks for any substring in functions, struct fields or global variable names. To start with strict mode, just add strict parameter:

go run ./cmd/lint/main.go --strict=true  --  ./...

# Packages

No description provided by the author
No description provided by the author