Skip to content

lugassawan/tidygo

Repository files navigation

tidygo

CI Go Reference Go Report Card License: MIT GitHub Release

A golangci-lint v2 plugin that enforces code ordering and structural conventions in Go source files.

Analyzers

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

Installation

Requirements: Go 1.26+, golangci-lint v2.

Create .custom-gcl.yml:

version: v2.10.1
plugins:
  - module: 'github.com/lugassawan/tidygo'
    version: v0.0.1

Configure .golangci.yml:

version: "2"

linters:
  enable:
    - tidygo
  settings:
    custom:
      tidygo:
        type: "module"

Build and run:

golangci-lint custom
./custom-gcl run ./...

Development

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)

License

MIT License — see LICENSE for details.

About

golangci-lint v2 plugin for Go code style: function naming, parameter limits, declaration ordering, export ordering, and struct placement

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors