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

Control Statement Parentheses Violation not detecting all violations #187

Closed
daniel-beard opened this issue Nov 5, 2015 · 0 comments
Closed

Comments

@daniel-beard
Copy link
Contributor

swiftlint version 0.3.0

Reproducible case:

import Foundation

class TestClass: TestObject {

    func enterUserFirstLastName(firstName: String,lastName: String) {
        let clearTextButton = app.buttons[kClearText]
        let firstNameField = app.tables.textFields[kFirstName]
        let lastNameField = app.tables.textFields[kLastName]
        firstNameField.tap()
        if(clearTextButton.exists) {
            clearTextButton.tap()
        }
        firstNameField.typeText(firstName)
        lastNameField.tap()
        if(clearTextButton.exists) {
            clearTextButton.tap()
        }
        lastNameField.typeText(lastName)
    }
}

Swiftlint output:

Linting Swift files in current working directory
Linting 'test.swift' (1/1)
/Users/dbeard/iphone/test.swift:1: warning: Leading Whitespace Violation: File shouldn't start with whitespace: currently starts with 1 whitespace characters
/Users/dbeard/iphone/test.swift:5: warning: Trailing Whitespace Violation: Line #5 should have no trailing whitespace
/Users/dbeard/iphone/test.swift:11:9: warning: Control Statement Parentheses Violation: if statements shouldn't wrap their conditionals in parentheses.
Done linting! Found 3 violations, 0 serious in 1 file.

Swiftlint picks up the first violation, but does not detect the second control statement violation.

mmorier added a commit to mmorier/SwiftLint that referenced this issue Nov 11, 2015
mmorier added a commit to mmorier/SwiftLint that referenced this issue Nov 11, 2015
jpsim added a commit that referenced this issue Nov 11, 2015
Improve ControlStatementRule for issues #187 and #189
@mmorier mmorier closed this as completed Nov 11, 2015
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

2 participants