-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Comma Spacing Violation: Should not be checked in String #234
Comments
I have a problem like this, |
@arsonik I can't reproduce your issue: $ echo "let reg = try! NSRegularExpression(pattern: \"[a-z]{2,5}\", options: NSRegularExpressionOptions.CaseInsensitive)" | swiftlint lint --use-stdin
<nopath>:1:11: error: Force Try Violation: Force tries should be avoided. (force_try)
<nopath>:1: warning: Line Length Violation: Line should be 100 characters or less: currently 110 characters (line_length)
Done linting! Found 2 violations, 1 serious in 1 file.
$ echo "let reg = try! NSRegularExpression(pattern: \"[a-z]{2, 5}\", options: NSRegularExpressionOptions.CaseInsensitive)" | swiftlint lint --use-stdin
<nopath>:1:11: error: Force Try Violation: Force tries should be avoided. (force_try)
<nopath>:1: warning: Line Length Violation: Line should be 100 characters or less: currently 111 characters (line_length)
Done linting! Found 2 violations, 1 serious in 1 file. @bjzhou I also can't reproduce your issue: $ echo "let url: String = \"https://www.google.com\"" | swiftlint lint --use-stdin
Done linting! Found 0 violations, 0 serious in 1 file.
$ echo "let url = \"https://www.google.com\"" | swiftlint lint --use-stdin
Done linting! Found 0 violations, 0 serious in 1 file. |
@jpsim Don't try in command line, this issue only occurred in Xcode. |
@jpsim I could reproduce it. The string is for the scope string of OAuth 2.0. |
Same issue here. |
Looks like its happening only when checked in a large file&or project. Sent from my iPhone
|
I'm still waiting for steps to reproduce this issue, as the details shared so far are insufficient to trigger it. |
//
// Created by 周斌佳 on 15/8/1.
// Copyright © 2015年 周斌佳. All rights reserved.
//
struct Test {
let url = "https://www.google.com"
let url: String = "https://www.google.com"
} @jpsim I reproduced my issue again, maybe the key is the comment. Please check it |
Thanks for sharing that @bjzhou, I can now reproduce the issue. I've reduced it even further: // 周斌佳年周斌佳
let abc: String = "abc:" Now I can investigate this. |
Should be fixed now. Thanks for reporting all! Next time, sharing a repro case really helps. |
Why would the program check if there is a space after a comma in a string ?
Example :
will fail if we add a space {2, 5}
cheers & good job by the way !
The text was updated successfully, but these errors were encountered: