Files
Niklas MischkulnigandGitHub 19ff1babf0 Lint against .context(format!(...)) (#91122)
There are unfortunately a few false-positives, because this isn't aware of type information of course.
2026-03-11 10:31:51 +01:00

24 lines
705 B
YAML

id: no-context-format
snapshots:
foo.bar().context(format!("{} failed", name)):
fixed: foo.bar().with_context(|| format!("{} failed", name))
labels:
- source: foo.bar().context(format!("{} failed", name))
style: primary
start: 0
end: 45
'foo.context(format!("error: {}", msg))':
fixed: 'foo.with_context(|| format!("error: {}", msg))'
labels:
- source: 'foo.context(format!("error: {}", msg))'
style: primary
start: 0
end: 38
foo.context(format!("simple message")):
fixed: foo.with_context(|| format!("simple message"))
labels:
- source: foo.context(format!("simple message"))
style: primary
start: 0
end: 38