A golangci-lint v2 plugin that enforces code ordering and structural conventions in Go source files.
| Analyzer | Description |
|---|---|
funcname |
Forbids underscores in function and method names |
maxparams |
Forbids functions with more than 7 parameters |
nolateconst |
Forbids const/var declarations after function declarations |
nolateexport |
Forbids exported functions after unexported functions |
nolocalstruct |
Forbids named struct type declarations inside function bodies |
Requirements: Go 1.26+, golangci-lint v2.
Create .custom-gcl.yml:
version: v2.10.1
plugins:
- module: 'github.com/lugassawan/tidygo'
version: v0.0.1Configure .golangci.yml:
version: "2"
linters:
enable:
- tidygo
settings:
custom:
tidygo:
type: "module"Build and run:
golangci-lint custom
./custom-gcl run ./...Prerequisites: mise
make init| Target | Description |
|---|---|
init |
Install tools, trust mise config, set up git hooks |
build |
Build custom golangci-lint with tidygo plugin |
lint |
Build and run golangci-lint (dogfooding) |
fmt |
Format all Go files with gofmt and golines |
test |
Run all tests |
coverage |
Generate HTML coverage report |
release |
Tag and push a semver release (VERSION=vX.Y.Z) |
MIT License — see LICENSE for details.