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

private_subject false positives in function scope #4643

Closed
2 tasks done
ejensen opened this issue Dec 13, 2022 · 0 comments · Fixed by #4646
Closed
2 tasks done

private_subject false positives in function scope #4643

ejensen opened this issue Dec 13, 2022 · 0 comments · Fixed by #4646
Labels
bug Unexpected and reproducible misbehavior.

Comments

@ejensen
Copy link

ejensen commented Dec 13, 2022

New Issue Checklist

Describe the bug

Starting in SwiftLint 0.50.0 the private_subject rule triggers on function local variables. This was not the case in 0.49.1 and earlier.

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

Environment

  • SwiftLint version (run swiftlint version to be sure)?
    • 0.50.3
  • Installation method used (Homebrew, CocoaPods, building from source, etc)?
    • CocoaPods
  • Paste your configuration file:
opt_in_rules:
  - private_subject
  • Are you using nested configurations?
    • No
  • Which Xcode version are you using (check xcodebuild -version)?
    • 14.1
  • Do you have a sample that shows the issue?
func foo() {
    // This triggers a violation "Private Combine Subject Violation: Combine Subject should be private. (private_subject)":
    let goodSubject = PassthroughSubject<Bool, Never>(true)
}
marcelofabri added a commit that referenced this issue Dec 16, 2022
@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Dec 16, 2022
marcelofabri added a commit that referenced this issue Dec 19, 2022
marcelofabri added a commit that referenced this issue Dec 19, 2022
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