Skip to main content

Lintme

A convenience wrapper around golangci-lint that discovers Go modules in your workspace and runs the linter per module with zero configuration fuss.

Overview

In a Go workspace (go.work) with many modules, running golangci-lint requires cd-ing into each module directory and invoking it separately. lintme automates that loop — one command from anywhere in the workspace lints everything.

Module discovery works with workspaces: when lintme finds a go.work file, it lints every module listed under a use directive, in order. When no go.work exists, it walks up from the current directory until it finds a go.mod and lints that single module.

For each module, lintme also walks up the directory tree to find the nearest .golangci.yaml (or an equivalent config file), so each module can carry its own linter config. Output streams in real time — nothing buffers it.

Requirements

Installation

go install github.com/StevenACoffman/lintme@latest

This places the lintme binary in $GOPATH/bin or $GOBIN. Ensure that directory is on your PATH.

Commands

Running bare lintme defaults to lintme branch — it lints only issues introduced on the current branch since its merge-base with the remote default branch.

lintme branch (Default)

Lint only issues introduced on the current branch.

# Lint issues introduced on the current branch (auto-detects merge-base)
lintme

# Specify the base branch explicitly
lintme branch -B main

# Apply formatting instead of linting
lintme --fmt-only

# Forward extra flags to every golangci-lint invocation
lintme -- --timeout=5m

lintme branch queries git ls-remote --symref origin HEAD to determine the remote default branch without requiring a local checkout. Use -B when there is no remote or the remote is not named origin.

Flag Default Description
-B, --base — Base branch for the merge-base computation; default: remote HEAD via ls-remote

lintme run

Lint all modules in the workspace, regardless of branch.

# Lint all modules, applying --fix (default)
lintme run

# Check only — do not modify files
lintme run --no-fix

# Format using golangci-lint fmt instead of golangci-lint run
lintme run --fmt-only

# Report only issues introduced since a given commit
lintme run --new-from-rev=main

# Forward extra flags to every golangci-lint invocation
lintme run -- --timeout=5m
lintme run --no-fix -- --timeout=5m --out-format=json

lintme pr

Lint only issues introduced by a GitHub pull request.

# Lint the PR for the current branch (auto-detects PR number)
lintme pr

# Lint a specific PR
lintme pr 123

# With an explicit token and repo
lintme pr --token=$GITHUB_TOKEN --repo=owner/repo 123

When <pr-number> is omitted, lintme pr detects the open PR for the current branch via the GitHub API, matching the behavior of gh pr view.

Flag Default Description
--token $GITHUB_TOKEN GitHub personal access token
--repo detected from git remote Repository as owner/repo
--github-url $GITHUB_API_URL GitHub API base URL for GitHub Enterprise

lintme version

Print build and version information.

lintme version         # human-readable table
lintme version --json  # machine-readable JSON

Shared Flags

These flags work with all commands that invoke golangci-lint.

Flag Default Description
--no-fix off Skip --fix; report issues without modifying files
--fmt-only off Run golangci-lint fmt instead of golangci-lint run; mutually exclusive with --no-fix
--new-from-rev=<rev> — Pass --new-from-rev=<rev> to every golangci-lint invocation; golangci-lint reports only issues introduced since <rev>

Module and Config Discovery

Module Discovery

lintme walks up from the current directory looking for a go.work file. When it finds one, it lints every module listed under a use directive in declaration order. When no go.work exists, it continues walking up until it finds a go.mod and lints that single module.

Config Discovery

For each module, lintme walks up from the module directory looking for a config file in this priority order:

  1. .golangci.yml
  2. .golangci.yaml
  3. .golangci.toml
  4. .golangci.json

The output header for each module shows the resolved path. When no config file exists, golangci-lint runs without --config and applies its own defaults.

Environment Variables

Every flag can also be set via a LINTME_-prefixed environment variable. The mapping rule: prepend LINTME_, uppercase, replace dashes with underscores.

Flag Environment variable
--no-fix LINTME_NO_FIX=true
--fmt-only LINTME_FMT_ONLY=true
--new-from-rev LINTME_NEW_FROM_REV=<rev>

Flags on the command line always take precedence over environment variables.

Output

==> ./services/auth (github.com/example/myapp/services/auth)  config: ./services/auth/.golangci.yaml
... golangci-lint output ...

==> ./services/payments (github.com/example/myapp/services/payments)  config: no config
... golangci-lint output ...

2/2 modules passed

When a module fails:

==> ./services/payments (github.com/example/myapp/services/payments)  config: no config
./services/payments/handler.go:42:9: unused variable (deadcode)
FAIL  ./services/payments: golangci-lint: exit status 1

1/2 modules passed

Failing modules do not stop remaining modules from linting. lintme exits non-zero if any module fails.

Exit Codes

Code Meaning
0 All modules passed
1 One or more modules failed

CI Integration

Use --no-fix in CI so the linter reports issues without modifying files.

- name: Lint
  run: lintme --no-fix

License

See LICENSE.

Release files for lintmego 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for lintmego 0.4.0
File
lintmego-0.4.0-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
lintmego-0.4.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
lintmego-0.4.0-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details
lintmego-0.4.0-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details
lintmego-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
lintmego-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
lintmego-0.4.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
lintmego-0.4.0-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details

Total release size: 57.9 MB

Release files / lintmego-0.4.0-py3-none-win_arm64.whl

Download URL lintmego-0.4.0-py3-none-win_arm64.whl
Size 7.0 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
4290c05dcbe5254ad62052b32968457690b049a2ec67a558ce6cb44d169427e3
BLAKE2b-256 checksum
How to use checksums
00872c37834d64b864edfb45cdd624afc336b2e5ddfd11c34c48cfeb15df8922
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Go-http-client/2.0

Release files / lintmego-0.4.0-py3-none-win_amd64.whl

Download URL lintmego-0.4.0-py3-none-win_amd64.whl
Size 7.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a73e990b37d1bffe95617d9ef668044886b388e06e05660b018ff65c3663a879
BLAKE2b-256 checksum
How to use checksums
206646aeab4011077eba9a7b21d126f29224f9fb1786483a891994f54de21c16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Go-http-client/2.0

Release files / lintmego-0.4.0-py3-none-musllinux_1_2_x86_64.whl

Download URL lintmego-0.4.0-py3-none-musllinux_1_2_x86_64.whl
Size 7.4 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
cd4a22a7bf00d7b5651505717e38c03343e40e4d0007862732b9aa7cc07f4a87
BLAKE2b-256 checksum
How to use checksums
02a149e28f7e355967a7a0a078fd8b3c27801459f0e34397c25e0300019c844b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Go-http-client/2.0

Release files / lintmego-0.4.0-py3-none-musllinux_1_2_aarch64.whl

Download URL lintmego-0.4.0-py3-none-musllinux_1_2_aarch64.whl
Size 6.9 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
88852db3411dc2ef68c53377b99c078cb365d902be4475f802167874fedc7148
BLAKE2b-256 checksum
How to use checksums
5315f472c7261142c588c8710a7e7a61aa52170b64a248426a52898f2cfab27e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Go-http-client/2.0

Release files / lintmego-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lintmego-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 7.4 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1c4af5752eff04a9b4fb1ce76ceb3812e32c72ce9dc78144da56c16b25326dc2
BLAKE2b-256 checksum
How to use checksums
f09cf3e88f04f0462e69403915fad68d7a811e87f6b593f5a2f20a16a4a35048
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Go-http-client/2.0

Release files / lintmego-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL lintmego-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.9 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
c31bf52750b74f6e1e51cc4fe8341666d06826b2a4723b58d096a651db095887
BLAKE2b-256 checksum
How to use checksums
8628d28d8040eb69a142a6f0fd08d5ef3a2aa60d8cf741150478c9ad5aeab54f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Go-http-client/2.0

Release files / lintmego-0.4.0-py3-none-macosx_11_0_arm64.whl

Download URL lintmego-0.4.0-py3-none-macosx_11_0_arm64.whl
Size 7.1 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ea94d8d5af1adaa07155fd20b2583dfcbc1c09dd0cdcb9f3757fcc0d7a1c724c
BLAKE2b-256 checksum
How to use checksums
d306d45c1b7966f7080e7bfe8bd083d6273f905601f75b4373921f3a8dd23848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Go-http-client/2.0

Release files / lintmego-0.4.0-py3-none-macosx_10_9_x86_64.whl

Download URL lintmego-0.4.0-py3-none-macosx_10_9_x86_64.whl
Size 7.6 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
6f56422a02e9e68d0827803fc89f4cf500c1931c0953119fb547915f06f43fff
BLAKE2b-256 checksum
How to use checksums
dff18ce93a077bb3b2942932154ce3a76724f601770ec76881e6038da31d9aad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Go-http-client/2.0

Release history Release notifications | RSS feed

This release

0.4.0 This release

8 release files

0.3.0

8 release files

0.2.0

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page