Repository navigation
docs(lint): stop LegacyLogMacroChecker claiming a cost the suffix cannot control (#4297) - #4396
Merged
Merged
Conversation
…not control
The checker's header said each call site "should use the `_F` printf-style
variant so the formatter lives in fl::printf instead of a fresh fl::sstream
chain per call site". That is not achievable by the spelling, and stating it
here sent readers looking for a cost the suffix does not control.
`src/fl/log/log.h:330` is:
#define FL_WARN_F(...) FL_WARN(__VA_ARGS__)
so the two are the same token sequence. What selects `log_emit_f` over
`log_emit` is the argument count -- one argument builds an `fl::sstream`, two
or more do not.
Behaviour is unchanged. The comment now says what the rule enforces, which is
a spelling, and points at #4297 for whether that is the right rule: `log.h`
tells new code to drop the suffix and "rely on argument-count dispatch", the
opposite instruction, and more than half the `_F` calls this rule approves are
single-argument ones that build the sstream anyway. That contradiction is a
decision with 1,760 call sites in scope; this change deliberately does not
take it, and says so.
Verified the macro identity by preprocessing rather than by reading the issue.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request updates the ChangesLogging checker documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Other · Severity of issue fixed: Low ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Addresses the factual half of #4297 without taking its decision.
The false claim
LegacyLogMacroChecker's header said each call siteThat is not achievable by the spelling.
src/fl/log/log.h:330:The two are the same token sequence. What selects
log_emit_foverlog_emitis the argument count — one argument builds anfl::sstream, two or more do not — and the suffix has no bearing on it. I verified the identity by preprocessing rather than by taking the issue's word for it.Stating a false mechanism in the checker is worse than stating nothing: it sends the next reader looking for a cost the rule does not control, and it is the justification someone would cite when deciding whether to keep the rule.
What this changes
The comment only. Behaviour is unchanged — the rule still enforces the
_Fspelling and still has no suppression.The comment now says what the rule actually enforces, and records the contradiction at the place someone hits it:
log.htells new code to drop the suffix and "rely on argument-count dispatch", the opposite instruction, and per #4297 more than half the_Fcalls this rule approves are single-argument ones that build the sstream anyway.What it deliberately does not do
Resolve #4297. That issue's option (1) is a lint rewrite over 1,760 call sites, and its option (2) retires a rule with no suppression — both decisions, not cleanups. The comment says so explicitly so the next person does not mistake an accurate rationale for a settled question.
bash lintclean; the crate's own 105 tests pass.Comment-only; no behaviour change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
Summary by CodeRabbit