-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add lint to avoid unwrap (#1422)
* test: add lint to avoid unwrap * update * Update crates/tabby-inference/src/lib.rs * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2542fde
commit ee92a9f
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
id: avoid-unwrap-if-possible | ||
message: Avoid unwrap, consider return Result with meaningful error message. | ||
severity: warning | ||
language: rust | ||
ignores: | ||
- ./crates/aim-downloader/* | ||
- ./crates/tabby/tests/* | ||
rule: | ||
all: | ||
- any: | ||
- kind: field_identifier | ||
regex: ^unwrap$ | ||
- kind: identifier | ||
regex: ^unwrap$ | ||
- not: | ||
inside: | ||
pattern: mod tests { $$$ } | ||
stopBy: end | ||
- not: | ||
inside: | ||
pattern: lazy_static! { $$$ } | ||
stopBy: end |