docs(lokitool): Use canonical rules format command and tidy help text#21730
Open
mastermanas805 wants to merge 1 commit intografana:mainfrom
Open
docs(lokitool): Use canonical rules format command and tidy help text#21730mastermanas805 wants to merge 1 commit intografana:mainfrom
mastermanas805 wants to merge 1 commit intografana:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
#21671 renamed
lokitool rules lint→rules format(keepinglintas 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 usesrules formatinstead ofrules lint.pkg/tool/commands/rules.go: fix two help-text typos (indentantion,outpupt); error wrapping in theformathandler saidprepare operation unsuccessful(copy-paste leftover fromprepare) — now readsformat operation unsuccessful; success log line and inline comment still saidlinted/linting— nowformatted.No behavior change. The
lintalias still works;LintDryRunandRuleNamespace.LintExpressionsare unchanged.Which issue(s) this PR fixes:
Refs #20288
Special notes for your reviewer:
Did not rename
LintDryRunonRuleCommandorRuleNamespace.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 -lall clean.Checklist
CONTRIBUTING.mdguide (required)docs/sources/setup/upgrade/_index.mddeprecated-config.yamlanddeleted-config.yamlfiles respectively in thetools/deprecated-config-checkerdirectory. Example PRNote
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 formatcommand (instead of the deprecatedrules lintalias).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.