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

// swiftlint:disable:this does not work if it placed on next line to // swiftlint:disable:next #1388

Closed
norio-nomura opened this issue Mar 24, 2017 · 0 comments · Fixed by #1557
Labels
bug Unexpected and reproducible misbehavior.

Comments

@norio-nomura
Copy link
Collaborator

Reproducing code:

// swiftlint:disable:next identifier_name
func ViolatingIdentifierName(){ // swiftlint:disable:this function_body_length opening_brace
    print("1")
    print("2")
    print("3")
    print("4")
    print("5")
    print("6")
    print("7")
    print("8")
    print("9")
    print("10")
    print("1")
    print("2")
    print("3")
    print("4")
    print("5")
    print("6")
    print("7")
    print("8")
    print("9")
    print("20")
    print("1")
    print("2")
    print("3")
    print("4")
    print("5")
    print("6")
    print("7")
    print("8")
    print("9")
    print("30")
    print("1")
    print("2")
    print("3")
    print("4")
    print("5")
    print("6")
    print("7")
    print("8")
    print("9")
    print("40")
    print("1")
}

function_body_length and opening_brace are detected:

swiftlint lint --enable-all-rules --path test.swift
Linting Swift files at path test.swift
Linting 'test.swift' (1/1)
Valid Docs rule is disabled in Swift 2.3 and later as it is non functional.
Missing Docs rule is disabled in Swift 2.3 and later as it is non functional.
/…/swiftlint-test/test.swift:2:1: warning: Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 41 lines (function_body_length)
/…/swiftlint-test/test.swift:2:30: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
Done linting! Found 2 violations, 0 serious in 1 file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants