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

class_delegate_protocol incorrectly triggering with Xcode 9.1 beta (9B37) #1856

Closed
2 tasks done
danj-stripe opened this issue Sep 27, 2017 · 0 comments · Fixed by #1857
Closed
2 tasks done

class_delegate_protocol incorrectly triggering with Xcode 9.1 beta (9B37) #1856

danj-stripe opened this issue Sep 27, 2017 · 0 comments · Fixed by #1857
Labels
bug Unexpected and reproducible misbehavior.

Comments

@danj-stripe
Copy link

danj-stripe commented Sep 27, 2017

New Issue Checklist

Bug Report

Complete output when running SwiftLint, including the stack trace and command used
$ echo 'protocol FooDelegate: class {}' | swiftlint --use-stdin --config swiftlint.yml 
Loading configuration from 'swiftlint.yml'
<nopath>:1:1: warning: Class Delegate Protocol Violation: Delegate protocols should be class-only so they can be weakly referenced. (class_delegate_protocol)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

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

0.22.0

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

Homebrew

  • Paste your configuration file:
whitelist_rules:
  - class_delegate_protocol

No

  • Which Xcode version are you using (check xcode-select -p)?
$ xcode-select -p
/Applications/Xcode-beta.app/Contents/Developer
$ xcodebuild -version
Xcode 9.1
Build version 9B37
  • 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.
// This triggers a violation:
protocol FooDelegate: class {}

More info

Upgrading to 9.1 also started showing (actual) violations of the colon rule for protocol declarations (I think that's be a good thing). Maybe something changed re: the parse tree for protocols?

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