Files
next.js/.config/ast-grep/rule-tests/__snapshots__/no-context-turbofmt-snapshot.yml
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

42 lines
1.2 KiB
YAML

id: no-context-turbofmt
snapshots:
foo.bar().context(turbofmt!("{} failed", name)):
fixed: foo.bar().with_context(|| turbofmt!("{} failed", name))
labels:
- source: foo.bar().context(turbofmt!("{} failed", name))
style: primary
start: 0
end: 47
foo.bar().context(turbofmt!("{} failed", name).await?):
labels:
- source: foo.bar().context(turbofmt!("{} failed", name).await?)
style: primary
start: 0
end: 54
'foo.context(turbofmt!("error: {}", msg))':
fixed: 'foo.with_context(|| turbofmt!("error: {}", msg))'
labels:
- source: 'foo.context(turbofmt!("error: {}", msg))'
style: primary
start: 0
end: 40
'foo.context(turbofmt!("error: {}", msg).await?)':
labels:
- source: 'foo.context(turbofmt!("error: {}", msg).await?)'
style: primary
start: 0
end: 47
foo.context(turbofmt!("simple message")):
fixed: foo.with_context(|| turbofmt!("simple message"))
labels:
- source: foo.context(turbofmt!("simple message"))
style: primary
start: 0
end: 40
foo.context(turbofmt!("simple message").await?):
labels:
- source: foo.context(turbofmt!("simple message").await?)
style: primary
start: 0
end: 47