-
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
Fix #2231 #2232
Fix #2231 #2232
Conversation
Generated by 🚫 Danger |
@@ -35,7 +35,7 @@ public struct IdentifierNameRule: ASTRule, ConfigurationProviderRule { | |||
return [] | |||
} | |||
|
|||
let isFunction = SwiftDeclarationKind.functionKinds.contains(kind) | |||
let isFunction = SwiftDeclarationKind.functionKinds.contains(kind) || kind == .enumelement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for better meaning you could separate in two variables. Like:
let isFunction = SwiftDeclarationKind.functionKinds.contains(kind)
let isEnumelement = kind == .enumelement
Or jus update the isFunction
to something like isFunctionOrEnumelement
.
We shouldn't change the rule behavior (i.e. |
@marcelofabri I'm having some trouble testing locally (many sourcekit errors, which it looks like they're already working on in SourceKitten). Let's see if these changes pass tests. |
Codecov Report
@@ Coverage Diff @@
## master #2232 +/- ##
==========================================
+ Coverage 92.03% 92.04% +<.01%
==========================================
Files 283 283
Lines 14246 14253 +7
==========================================
+ Hits 13112 13119 +7
Misses 1134 1134
Continue to review full report at Codecov.
|
Can we get this merged in soon? :) |
I've tested this and it looks like SourceKit reports incorrect values for We should fill an issue in bugs.swift.org and meanwhile we can get the substring from To avoid any potential issues, I'd only do that if |
@@ -85,6 +85,10 @@ | |||
|
|||
#### Bug Fixes | |||
|
|||
* Fix identifier name false positive for enum cases with associated values in Xcode 10. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requires two trailing spaces and lines should be limited to 80 chars as described in CONTRIBUTING.md: https://github.com/realm/SwiftLint/blob/master/CONTRIBUTING.md#tracking-changes
Any update on this? |
Closing this in favor of #2255 |
Thank you @marcelofabri! |
SwiftLint fails with an error in enums with associated types in Xcode 10 due to the
identifier_name
rule. This fixes that error.