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

Accept variable names starting with more than one capital letter in Variable Name Rule #566

Closed
eaigner opened this issue Feb 25, 2016 · 2 comments
Labels
enhancement Ideas for improvements of existing features and rules. good first issue Issue to be taken up by new contributors yet unfamiliar with the project.

Comments

@eaigner
Copy link

eaigner commented Feb 25, 2016

Consider the following variable names

- ID
- URL
- XMLString
- APIHost
- HTTPVersion
- MIMEType
- JSONBody
- URLField
- URLStackView

Those would be considered a violation because they start with an uppercase letter, but in those examples they are abbreviations which would be valid.

I know those can be excluded manually, but I don't think it is necessary. Those cases could be detected if the 2nd character is also upper case and contains only alphanumeric characters (thus eliminating cases such as MY_CONST)

I'm using swiftlint version 0.9.1

@jpsim jpsim changed the title Automatically detect valid variable_name casing Accept variable names starting with more than one capital letter in Variable Name Rule Feb 25, 2016
@jpsim jpsim added enhancement Ideas for improvements of existing features and rules. good first issue Issue to be taken up by new contributors yet unfamiliar with the project. labels Feb 25, 2016
@jpsim
Copy link
Collaborator

jpsim commented Feb 25, 2016

We were tracking this enhancement in a pull request that was never finished and subsequently closed, so I just renamed this issue to be a more accurate description of what should be done, and now we're tracking this enhancement here.

Anyone should feel free to implement this. It should be an easy task to get started if you've been considering contributing to SwiftLint.

@eaigner
Copy link
Author

eaigner commented Feb 26, 2016

Implemented it and CI seems to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules. good first issue Issue to be taken up by new contributors yet unfamiliar with the project.
Projects
None yet
Development

No branches or pull requests

2 participants