tidygo

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 7 Imported by: 0

README

tidygo

CI Go Reference Go Report Card

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: v1.0.0

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.

Documentation

Overview

Package tidygo registers custom lint analyzers as a golangci-lint v2 module plugin.

Directories

Path Synopsis
Package funcname defines an analyzer that forbids underscores in function names.
Package funcname defines an analyzer that forbids underscores in function names.
Package maxparams defines an analyzer that reports functions with more than 7 parameters.
Package maxparams defines an analyzer that reports functions with more than 7 parameters.
Package nolateconst defines an analyzer that forbids package-level const and var declarations that appear after any function or method declaration.
Package nolateconst defines an analyzer that forbids package-level const and var declarations that appear after any function or method declaration.
Package nolateexport defines an analyzer that forbids exported standalone functions (no receiver) that appear after unexported standalone functions.
Package nolateexport defines an analyzer that forbids exported standalone functions (no receiver) that appear after unexported standalone functions.
Package nolocalstruct defines an analyzer that forbids named struct type declarations inside function bodies.
Package nolocalstruct defines an analyzer that forbids named struct type declarations inside function bodies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL