Swiftlint: identifier_name error . Xcode 9.3, High Sierra

Created on 2 Apr 2018  路  6Comments  路  Source: realm/SwiftLint

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

question

Most helpful comment

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

All 6 comments

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

Thank you! Decided to update configuration file.

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

@RishabhTayal what is your code example?

@RishabhTayal please open a new issue filling the template

@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.

Was this page helpful?
0 / 5 - 0 ratings