8000 Make `@unreleased` mutually exclusive with `@deprecated` by EliTheGingerCat · Pull Request #167 · evaera/moonwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make @unreleased mutually exclusive with @deprecated #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extractor/src/tags/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ static MUTUALLY_EXCLUSIVE: &[(TagType, TagType)] = &[
(TagType::Yields, TagType::Class),
// Can't be unreleased and released at the same time
(TagType::Unreleased, TagType::Since),
(TagType::Unreleased, TagType::Deprecated),
// Readonly doesn't make sense on a function
(TagType::Function, TagType::ReadOnly),
];
Expand Down
4 changes: 4 additions & 0 deletions extractor/test-input/failing/class_with_unused_tags.lua
Copy link
Collaborator
@YetAnotherClown YetAnotherClown Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this fits in this test file. This test file is for tags which aren't used on classes, when usage tags are something we could use on classes. It might be better to make a exclusive_tags test. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having a test file dedicated to classes with unused tags is too specific. A general exclusive_tags.luau file would be better, though the file should still contain this test case with the class.

Copy link
Collaborator
@YetAnotherClown YetAnotherClown Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree, we'll leave the PR as it is and treat this test case as exclusive tags. I could rename the tests sometime, but I'm not too worried about that really.

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
@yields
@error E -- This
@return string -- a string

@unreleased
@since v0.1.0
@deprecated v1.0.0
]=]
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,21 @@ error: This tag is mutually exclusive...
3 │ @yields
│ ------- ...with this tag.

error: aborting due to diagnostic error
error: This tag is mutually exclusive...
┌─ test-input/failing/class_with_unused_tags.lua:7:2
7 │ @unreleased
│ ^^^^^^^^^^^ This tag is mutually exclusive...
8 │ @since v0.1.0
│ ------------- ...with this tag.

error: This tag is mutually exclusive...
┌─ test-input/failing/class_with_unused_tags.lua:7:2
7 │ @unreleased
│ ^^^^^^^^^^^ This tag is mutually exclusive...
8 │ @since v0.1.0
9 │ @deprecated v1.0.0
│ ------------------ ...with this tag.

error: aborting due to diagnostic error
0