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

Excluding the identifier_name 'no' disables all exclusions #1616

Closed
CraigSiemens opened this issue Jun 12, 2017 · 1 comment
Closed

Excluding the identifier_name 'no' disables all exclusions #1616

CraigSiemens opened this issue Jun 12, 2017 · 1 comment

Comments

@CraigSiemens
Copy link
Contributor

CraigSiemens commented Jun 12, 2017

Using version 0.19.0. Worked fine in 0.17.0.

When I exclude the identifier_name no, all other excluded variable names are ignored.

Source

let a = 1
let no = 2
let b = 3

.swiftlint.yml

identifier_name:
  excluded:
    - a
    - no #Commenting this line will cause a,b to be excluded
    - b

Using this swift lint file causes a, no, and b to be marked as violations.

$ swiftlint lint
Loading configuration from '.swiftlint.yml'
Linting Swift files in current working directory
Linting 'test.swift' (1/1)
/Users/craig/Desktop/SwiftLintTest/test.swift:1:1: error: Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'a' (identifier_name)
/Users/craig/Desktop/SwiftLintTest/test.swift:2:1: warning: Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'no' (identifier_name)
/Users/craig/Desktop/SwiftLintTest/test.swift:3:1: error: Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'b' (identifier_name)
Done linting! Found 3 violations, 2 serious in 1 file.

Commenting out the no exclusion in the swift lint file allows a, and b to be ignored properly.

$ swiftlint lint
Loading configuration from '.swiftlint.yml'
Linting Swift files in current working directory
Linting 'test.swift' (1/1)
/Users/craig/Desktop/SwiftLintTest/test.swift:2:1: warning: Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'no' (identifier_name)
Done linting! Found 1 violation, 0 serious in 1 file.

Also tried wrapping the names in the swift lint file in both double and single quotes but that had no effect.

@norio-nomura
Copy link
Collaborator

duplicate of #1424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants