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

identifier_name error . Xcode 9.3, High Sierra #2134

Closed
dastan28 opened this issue Apr 2, 2018 · 6 comments
Closed

identifier_name error . Xcode 9.3, High Sierra #2134

dastan28 opened this issue Apr 2, 2018 · 6 comments
Labels
question Question or doubts that needs discussion and clarification. Can become a bug or proposal.

Comments

@dastan28
Copy link

dastan28 commented Apr 2, 2018

Hi guys!
Recently I've updated my Xcode and OS to High Sierra, but got weird SwiftLint error.
I have code guard let x = variable else { return } which gives me an error Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name) . As far as I know, SwiftLint should skips common variables like i,x,y and etc. I've already checked out other closed issues regarding identifier_name, but didn't quite get whether the issue is already fixed or not. May you please help?
Details: Xcode 9.3, High Sierra, SwifLint: (0.25.0) via Cocoapods

@dastan28 dastan28 changed the title 'x' (identifier_name) too short error identifier_name error . Xcode 9.3, High Sierra Apr 2, 2018
@marcelofabri
Copy link
Collaborator

SwiftLint started validating local variables with Xcode 9.3. To exclude a variable you can either disable the rule it locally or add exceptions to the configuration:

identifier_name:
  min_length: # only min_length
    error: 4 # only error
  excluded: # excluded via string array
    - id
    - URL
    - GlobalAPIKey

@marcelofabri marcelofabri added the question Question or doubts that needs discussion and clarification. Can become a bug or proposal. label Apr 2, 2018
@dastan28
Copy link
Author

dastan28 commented Apr 2, 2018

Thank you! Decided to update configuration file.

@dastan28 dastan28 closed this as completed Apr 2, 2018
@RishabhTayal
Copy link

@marcelofabri, I am also getting error in Xcode 9.3. I am getting it for weak_delegate rule.

@dastan28
Copy link
Author

dastan28 commented Apr 2, 2018

@RishabhTayal what is your code example?

@marcelofabri
Copy link
Collaborator

@RishabhTayal please open a new issue filling the template

@RishabhTayal
Copy link

@marcelofabri, I wasn't on the latest version of swiftlint. I updated to the latest version and now I am not getting error. Everything is ok. Sorry for false alarm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or doubts that needs discussion and clarification. Can become a bug or proposal.
Projects
None yet
Development

No branches or pull requests

3 participants