Skip to content

Repository files navigation

retrogolint

CI Codecov Release License LLM assisted: human reviewed

A Go static analyzer that enforces conventions for projects built with retrogolib.

Features

  • Retrogolib-aware checks - Finds issues that general-purpose Go linters do not cover
  • Flexible targets - Analyzes files, directories, and Go package patterns such as ./...
  • Rule selection - Runs or disables individual rules and complete rule categories
  • Configurable severity - Reports violations at or above the selected severity
  • Targeted exclusions - Excludes tests, directories, and file patterns globally or per rule
  • CI output - Produces concise text or structured JSON output

Rule Categories

Category Checks
Logging Message style, structured fields, logger use, and eager field evaluation
Testing Manual assertions that can use retrogolib/assert
Collections Map-based sets and inefficient retrogolib/set operations
Code quality Function signature layout, declaration order, parameter order, parameter type grouping, and exported type names

See the rule reference for rule details and examples.

Quick Start

Installation

Download a prebuilt binary from Releases, or install from source with Go 1.22 or later:

go install github.com/retroenv/retrogolint/cmd/retrogolint@latest

Basic Usage

Analyze the current module:

retrogolint ./...

Analyze a package tree:

retrogolint ./internal/compiler/...

Output JSON for CI or tooling:

retrogolint -format json ./...

Run only logging rules:

retrogolint -rules logging ./...

Disable a rule or category:

retrogolint -disabled-rules collections-map-set ./...

If no paths are provided, retrogolint analyzes ./....

Configuration

retrogolint reads .retrogolint.ini by default. Command-line flags override file settings. The configuration supports global exclusions and exclusions for individual rules or rule categories.

See the configuration reference for all options and examples.

About

Go linter for logging best practices, field conventions, and code quality

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages