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

Exclude enum cases from type_name rule #655

Closed
phelgo opened this issue May 6, 2016 · 2 comments
Closed

Exclude enum cases from type_name rule #655

phelgo opened this issue May 6, 2016 · 2 comments

Comments

@phelgo
Copy link
Contributor

phelgo commented May 6, 2016

The type_name rule is currently being applied to enum cases. While the capital and alphanumerical requirements apply perfectly to enum cases, the minimum length may not. Examples like Direction.Up, Sixe.XL, Cardinal.SW should be allowed, and it feels cumbersome to add all these exceptions to the .swiflint.yml

@chadmoone
Copy link

I'm not sure about this. Potentially some default exceptions should be added for common two-letter words (up, in, id etc). But your other examples are acronyms/abbreviations, which most styleguides discourage to begin with. Personally, I don't see why enum cases should be treated differently than anything else in this regard. If your application really needs to have several two-letter enum types, you can always customize the rule to change the minimum allowed to 2.

@jpsim
Copy link
Collaborator

jpsim commented Jun 8, 2016

as of #660, we allow lowercase names for enum cases.

@jpsim jpsim closed this as completed Jun 8, 2016
NachoSoto added a commit to NachoSoto/SwiftLint that referenced this issue Jan 4, 2017
…ase in Swift 3

To my surprise, the `type_name` rule is not currently validating this. I've found some issues referring to this (realm#655, realm#654, realm#663, and the change in realm#660),
but it's not clear to me whether not validating this was on purpose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants