fleetlint Policy for a fleet of repositories
v0.3
Getting started

lint/go-linters-enabled

golangci-lint enables the baseline linters

Severitywarning
Tiersall
Stacksgo
Scopeeach
Kindexpr
Sourcelibrary v0.0.0-20261011205826-ecb4e9b3ffd4
Selected byfleetlint-recommended@0.1.0

Requirement

The golangci-lint configuration enables every linter in params.required, directly or through default: all.

Why

Swallowed errors, unsafe calls and oversized functions are exactly what these linters catch.

Applies when

file(".golangci.yml") || file(".golangci.yaml")

Check

For each item in:

params.required
yaml(file(".golangci.yml") ? ".golangci.yml" : ".golangci.yaml") != null && has(yaml(file(".golangci.yml") ? ".golangci.yml" : ".golangci.yaml").linters) && (
  (has(yaml(file(".golangci.yml") ? ".golangci.yml" : ".golangci.yaml").linters.default)
    && yaml(file(".golangci.yml") ? ".golangci.yml" : ".golangci.yaml").linters.default == "all")
  || (has(yaml(file(".golangci.yml") ? ".golangci.yml" : ".golangci.yaml").linters.default)
    && yaml(file(".golangci.yml") ? ".golangci.yml" : ".golangci.yaml").linters.default == "standard"
    && item in ["errcheck", "govet", "staticcheck", "unused", "ineffassign"])
  || (has(yaml(file(".golangci.yml") ? ".golangci.yml" : ".golangci.yaml").linters.enable)
    && item in yaml(file(".golangci.yml") ? ".golangci.yml" : ".golangci.yaml").linters.enable)
)

Parameters

  • required: [errcheck govet staticcheck errorlint gosec gocognit funlen]

Fix

Add the missing linters to linters.enable in .golangci.yml.

Agent instruction: Add each reported linter to the linters.enable list in .golangci.yml; keep the rest of the file unchanged.

See: https://fleetlint.org/stacks/#go


Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.