Skip to content

docs(lokitool): Use canonical rules format command and tidy help text#21730

Open
mastermanas805 wants to merge 1 commit intografana:mainfrom
mastermanas805:refactor/20288-lint-check-naming
Open

docs(lokitool): Use canonical rules format command and tidy help text#21730
mastermanas805 wants to merge 1 commit intografana:mainfrom
mastermanas805:refactor/20288-lint-check-naming

Conversation

@mastermanas805
Copy link
Copy Markdown

@mastermanas805 mastermanas805 commented Apr 29, 2026

What this PR does / why we need it:

#21671 renamed lokitool rules lintrules format (keeping lint as a deprecated alias). The alerting docs still pointed at the deprecated form, and a few user-visible strings inside the renamed handler weren't updated — that's the part of #20288 that remains user-visible after #21671 merged.

Changes:

  • docs/sources/alert/_index.md: example uses rules format instead of rules lint.
  • pkg/tool/commands/rules.go: fix two help-text typos (indentantion, outpupt); error wrapping in the format handler said prepare operation unsuccessful (copy-paste leftover from prepare) — now reads format operation unsuccessful; success log line and inline comment still said linted/linting — now formatted.

No behavior change. The lint alias still works; LintDryRun and RuleNamespace.LintExpressions are unchanged.

Which issue(s) this PR fixes:
Refs #20288

Special notes for your reviewer:
Did not rename LintDryRun on RuleCommand or RuleNamespace.LintExpressions — those are Go-API-visible and feel like a separate cleanup. Happy to fold in if preferred.

Verified locally: go build, go vet, go test ./pkg/tool/commands/..., gofmt -l all clean.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

Note

Low Risk
Docs and user-facing message/typo fixes only; no functional changes to rule parsing or formatting behavior.

Overview
Updates the alerting documentation example to use the canonical lokitool rules format command (instead of the deprecated rules lint alias).

Cleans up user-facing strings in lokitool rules format: fixes help-text typos, updates error wrapping to reference the format operation, and adjusts the inline comment and success log line to say "formatted" rather than "linted."

Reviewed by Cursor Bugbot for commit b3efe11. Bugbot is set up for automated code reviews on this repo. Configure here.

The `rules lint` subcommand was renamed to `rules format` in grafana#21671 and
`lint` was kept only as a deprecated alias, but the alerting docs still
guide users to the alias. Update the example to call `rules format`.

While in the area, fix a few loose ends from the rename inside
`pkg/tool/commands/rules.go`:

- Correct typos in user-visible help text (`indentantion`, `outpupt`).
- Update the leftover `prepare operation unsuccessful` error wraps in
  the renamed `format` handler so they match the command name.
- Update the comment and success log message to read `formatted`
  instead of `linting`/`linted`. The underlying
  `RuleNamespace.LintExpressions` API is unchanged.

No behavior change. The `lint` alias still works.

Refs grafana#20288
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Apr 29, 2026

CLA assistant check
All committers have signed the CLA.

@mastermanas805 mastermanas805 marked this pull request as ready for review April 29, 2026 11:44
@mastermanas805 mastermanas805 requested a review from a team as a code owner April 29, 2026 11:44
Copy link
Copy Markdown
Contributor

@chaudum chaudum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@chaudum chaudum enabled auto-merge (squash) May 6, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants