-
Notifications
You must be signed in to change notification settings - Fork 24
Migrate all T::Enum usages to bare Ruby classes
#843
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
ffdc7a5 to
5923f4b
Compare
T::Enum usages to bare Ruby classes
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
5923f4b to
40f6f84
Compare
| when "protected" then Protected | ||
| when "private" then Private | ||
| else | ||
| raise Error, "Invalid visibility: #{name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better to raise ArgumentError here:
| raise Error, "Invalid visibility: #{name}" | |
| raise ArgumentError, "Invalid visibility: #{name}" |
| def yellow(string); end | ||
| end | ||
|
|
||
| Spoom::Cli::Helper::HIGHLIGHT_COLOR = T.let(T.unsafe(nil), Spoom::Color) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be definitely be here: https://github.com/Shopify/spoom/blob/main/lib/spoom/cli/helper.rb#L106.
I think it wasn't before because the constant was pointing to the enum variant instead of a real constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, makes sense!
Also enable
Sorbet/ForbidTEnumcop after that.