Files
Matt MastracciandGitHub 1bc8f55993 Add Err(anyhow(... ast-grep rule (#90869)
# What

Add an ast-grep rule to use `bail!` rather than `Err(anyhow!(` in a
return position.

# Why

This is slightly more compact, and allows us to port more code over to
turbofmt/turbobail.

Note: _this PR was previously merged into another branch due to a GH
bug_
2026-03-04 09:08:55 -07:00

27 lines
629 B
YAML

id: no-err-anyhow
snapshots:
Err(anyhow!("error message")):
labels:
- source: Err(anyhow!("error message"))
style: primary
start: 0
end: 29
'Err(anyhow!("error: {}", msg))':
labels:
- source: 'Err(anyhow!("error: {}", msg))'
style: primary
start: 0
end: 30
Err(anyhow::anyhow!("error message")):
labels:
- source: Err(anyhow::anyhow!("error message"))
style: primary
start: 0
end: 37
'Err(anyhow::anyhow!("error: {}", msg))':
labels:
- source: 'Err(anyhow::anyhow!("error: {}", msg))'
style: primary
start: 0
end: 38