Skip to content
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

Add rules for enum cleanup #399

Open
Satyam1749 opened this issue Feb 27, 2023 · 0 comments · May be fixed by #397
Open

Add rules for enum cleanup #399

Satyam1749 opened this issue Feb 27, 2023 · 0 comments · May be fixed by #397

Comments

@Satyam1749
Copy link
Collaborator

Satyam1749 commented Feb 27, 2023

In swift, we use switch in enums to populate computed properties.Rules should be created to cleanup any enum entry from all such variables.

example:
Before

enum TestEnum {
   case one
   case two
   case three

   var v1: String {
      switch self {
      case .one:
         return "one"
      case .two:
         return "two"
      case .three:
         return "three"
      }
   }
}

After

enum TestEnum {
   case two
   case three

   var v1: String {
      switch self {
      case .two:
         return "two"
      case .three:
         return "three"
      }
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants