Skip to content

add mage:lint targets#431

Open
ivanauth wants to merge 1 commit into
authzed:mainfrom
ivanauth:ic/mage-lint-targets
Open

add mage:lint targets#431
ivanauth wants to merge 1 commit into
authzed:mainfrom
ivanauth:ic/mage-lint-targets

Conversation

@ivanauth
Copy link
Copy Markdown
Contributor

@ivanauth ivanauth commented Jun 2, 2026

Summary

Resolves #429.

Adds a Lint mage namespace mirroring the linters CI runs, so developers can run mage lint locally and catch issues before pushing.

Resolves authzed#429.

Adds a `Lint` mage namespace mirroring the linters CI runs so devs can
run `mage lint` locally and catch issues before pushing.

Targets:
- `lint:all` — runs `lint:go` + `lint:extra`
- `lint:go` — runs `gen:all` (codegen drift check), then gofumpt,
  golangci-lint --fix, and `go mod tidy` serially
- `lint:extra` — yaml, markdown, kustomize build
- Sub-targets are also individually runnable (e.g. `mage lint:gofumpt`)

Notes:
- `lint:all` and `lint:go` use `mg.SerialDeps`: `lint:go` writes to
  config/crds + config/rbac via codegen, and `lint:kustomize` reads
  ./config, so they must not race; the gofumpt/golangci-lint/tidy chain
  inside `lint:go` also mutates files in place.
- `lint:tidy` runs in root + ./tools + ./e2e. ./magefiles is omitted
  because it has no separate go.mod and resolves to the root module.
- golangci-lint is pinned to v2.12.2 to match the version used by
  `authzed/actions/golangci-lint`.
- Targets that use `--fix` (gofumpt, golangci-lint) modify files in
  place, matching the pattern in sibling `authzed/spicedb` repo.
- Generalized `checkDocker` error message; it is now used by
  `lint:yaml` and `lint:markdown` in addition to e2e tests.

Also fixes a pre-existing MD059 violation in CODE-OF-CONDUCT.md that
the new `lint:markdown` target surfaces.
@ivanauth ivanauth force-pushed the ic/mage-lint-targets branch from c58b0c8 to f945acd Compare June 2, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add mage:lint targets

1 participant