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

False positive for rule identifier_name in Xcode 10 beta #2231

Closed
Jeehut opened this issue Jun 5, 2018 · 14 comments
Closed

False positive for rule identifier_name in Xcode 10 beta #2231

Jeehut opened this issue Jun 5, 2018 · 14 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@Jeehut
Copy link
Collaborator

Jeehut commented Jun 5, 2018

Hey guys,

I've just received a bug report in one of my open source projects here which is related to the identifier_name rule. Specifically here's the code where the rule triggers an error:

extension String {
    /// The type of allowed characters.
    ///
    /// - Numeric:          Allow all numbers from 0 to 9.
    /// - Alphabetic:       Allow all alphabetic characters ignoring case.
    /// - AlphaNumeric:     Allow both numbers and alphabetic characters ignoring case.
    /// - AllCharactersIn:  Allow all characters appearing within the specified String.
    public enum AllowedCharacters {
        case numeric
        case alphabetic
        case alphaNumeric
        case allCharactersIn(String) // Identifier Name Violation: Enum element name should only contain alphanumeric characters ...
    }
}

As you can see it's complaining about – probably – the braces which shouldn't be the case.

I'm using SwiftLint 0.25.1.

Coder-256 added a commit to Coder-256/SwiftLint that referenced this issue Jun 5, 2018
@Coder-256
Copy link

I fixed this in my PR #2232

@jorgecmoura
Copy link

I'm using Xcode 10 Beta 6 and I'm still getting this error. I'm using swiftlint 0.27.0.

Probably I'm missing some detail. Anyone else getting this error?

@shagedorn
Copy link

Maybe your command line tools are still set to an older version of Xcode?

Check via Xcode > Preferences > Locations, or the xcode-select -p command.

@jorgecmoura
Copy link

Good point. In fact they still were pointing to Xcode 9.4.1.

However, I'm still getting the error (command line tools now on 10.0).

@flashspys
Copy link

The problem was solved for me by upgrading to the latest swiftlint version and setting the xcode-select path to the beta xcode

@emadhegab
Copy link

still not working with latest official xcode release !

@jorgecmoura
Copy link

Sorry for the lack of update. Yes, is it working :)
It was probably something around having Xcode and Xcode-Beta running in same machine, together with some inability from me to quickly identify and fix that ;)

@emadhegab
Copy link

@jorgecmoura I don't have xcode beta any more and yet .. it's still give me same error!

@ValentinFesenko
Copy link

ValentinFesenko commented Sep 18, 2018

still not working with latest official xcode release !

I think you can manually choose the last version of the SwiftLint. It helped me.
Use this one:
pod 'SwiftLint', '~> 0.27'
instead of this
pod 'SwiftLint'

@geraldeersteling
Copy link

I'm on SwiftLint 0.27.0 and it still happens 😕, shouldn't this be fixed on that version?

@rafalszastok
Copy link

Small update. I noticed swiftlint is working properly, but danger extension use old 0.26 build.
PR: ashfurrow/danger-ruby-swiftlint#110

@kaybutter
Copy link

kaybutter commented Oct 2, 2018

@rafalszastok You can work around this by telling danger to use the system swiftlint in your Dangerfile:

swiftlint.binary_path = "/usr/local/bin/swiftlint"

@dennishahn
Copy link

I still see this problem. We are using XCode 10, swift version 4.2 and swiftLint 0.27.0

@madhus1025
Copy link

I'm on SwiftLint 0.27.0 and it still happens 😕, shouldn't this be fixed on that version?

Any update on this ?

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

No branches or pull requests