-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add a witness for
enum_variant_missing
(#978)
* made sure that variant missing has a witness * made sure that the whitness respects tuple, struct and plain enums with the correct brackets * fixed line numbers having shifted due to whitepace fixes * Apply suggestions from code review * apply cargo fmt * fixed things missed while rebasing onto remote --------- Co-authored-by: Predrag Gruevski <[email protected]>
- Loading branch information
1 parent
ed5fa24
commit 4ca3198
Showing
6 changed files
with
85 additions
and
7 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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
pub enum VariantWillBeRemoved { | ||
pub enum PlainVariantWillBeRemoved { | ||
Foo, | ||
} | ||
|
||
pub enum TupleVariantWillBeRemoved { | ||
Foo(usize), | ||
} | ||
|
||
pub enum StructVariantWillBeRemoved { | ||
Foo { bar: usize }, | ||
} |
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
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,24 @@ | ||
--- | ||
source: src/query.rs | ||
description: "Lint `enum_variant_missing` did not have the expected witness output.\nSee https://github.com/obi1kenobi/cargo-semver-checks/blob/main/CONTRIBUTING.md#testing-witnesses\nfor more information." | ||
expression: "&actual_witnesses" | ||
--- | ||
[["./test_crates/enum_struct_variant_field_missing/"]] | ||
filename = 'src/lib.rs' | ||
begin_line = 14 | ||
hint = 'let witness = enum_struct_variant_field_missing::IgnoredEnum::StructVariantWillBeMissing {...};' | ||
|
||
[["./test_crates/enum_variant_missing/"]] | ||
filename = 'src/lib.rs' | ||
begin_line = 4 | ||
hint = 'let witness = enum_variant_missing::PlainVariantWillBeRemoved::Bar;' | ||
|
||
[["./test_crates/enum_variant_missing/"]] | ||
filename = 'src/lib.rs' | ||
begin_line = 10 | ||
hint = 'let witness = enum_variant_missing::TupleVariantWillBeRemoved::Bar(...);' | ||
|
||
[["./test_crates/enum_variant_missing/"]] | ||
filename = 'src/lib.rs' | ||
begin_line = 18 | ||
hint = 'let witness = enum_variant_missing::StructVariantWillBeRemoved::Bar {...};' |