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

Colon rule doesn't show warning for generic types #2628

Closed
commscheck opened this issue Feb 3, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@commscheck
Copy link

commented Feb 3, 2019

New Issue Checklist

Describe the bug

'Colon' rule does not trigger for class and struct definitions if the type is generic.

Complete output when running SwiftLint, including the stack trace and command used

Input:

import Foundation

print("Hello, World!")

protocol MyProtocol { }

class Baz<String> : MyProtocol { }
struct Qux<String> : MyProtocol { }

Command Line:

$ swiftlint lint
Linting Swift files at paths
Linting 'main.swift' (1/1)
Done linting! Found 0 violations, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)?

    • 0.30.1
  • Installation method used (Homebrew, CocoaPods, building from source, etc)?

    • Homebrew
  • Paste your configuration file:

    • N/A
  • Are you using nested configurations?
    If so, paste their relative paths and respective contents.

    • No
  • Which Xcode version are you using (check xcode-select -p)?

    • Xcode 10.1
  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules to quickly test if your example is really demonstrating the issue. If your example is more complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.

// These trigger a warning as expected:
class Foo : MyProtocol { }
struct Bar : MyProtocol { }

// These do not:
class Baz<String> : MyProtocol { }
struct Qux<String> : MyProtocol { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.