-
Notifications
You must be signed in to change notification settings - Fork 1.7k
consider a use_enums
lint to encourage migration from enum-like classes to enhanced enums
#58624
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
Comments
prefer_enums
lintprefer_enums
lint to encourage migration from enum-like classes to enhanced enums
Like other language feature migration lints, this is a lint that I would want to have ship with a quickfix to make it easy for users to learn how to do the migration. |
As a starting point we can probably use the existing definition of an enum-like class to define which classes to lint, but we might need to make some adjustments. For reference, the documentation currently states:
We probably need to add at least one additional criteria:
If enums aren't allowed to have mixins then we'll also need to check that the class being linted doesn't have a Are there other criteria we need to check for? |
My first cut implementation settled on a slight variation on the list above. (See PR.) TL;DR:
As mentioned in the WIP PR, the |
prefer_enums
lint to encourage migration from enum-like classes to enhanced enumsuse_enums
lint to encourage migration from enum-like classes to enhanced enums
No description provided.
The text was updated successfully, but these errors were encountered: