Skip to content
Snippets Groups Projects

dev/sg: add suggestions for fixable sg lints

Created by: bobheadxi

In practice, this only works for the go check at the moment, which has the fixable go-generate check, but other linters can implement Fix as well in the future :grin:

Test plan

Add a test lint target that is always broken, but is "fixable":

	{
		Name:        "test",
		Description: "Check for broken urls in the codebase",
		Checks: []*linter{
			{
				Name: "test",
				Check: func(ctx context.Context, out *std.Output, args *repo.State) error {
					return errors.New("ah")
				},
				Fix: func(ctx context.Context, cio check.IO, args *repo.State) error {
					cio.WriteSuccessf("Yay!")
					return nil
				},
			},
		},
	},

Get a suggestion!

image

Merge request reports

Approval is optional

Merged by avatar (Oct 8, 2025 11:40pm UTC)

Merge details

  • Changes merged into main with fb3eb508.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading