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

type_contents_order false positive with willMove(toParent:) #3478

Closed
2 tasks done
kacper1703 opened this issue Dec 23, 2020 · 1 comment · Fixed by #4201
Closed
2 tasks done

type_contents_order false positive with willMove(toParent:) #3478

kacper1703 opened this issue Dec 23, 2020 · 1 comment · Fixed by #4201
Labels
bug Unexpected and reproducible misbehavior.

Comments

@kacper1703
Copy link

New Issue Checklist

Describe the bug

For a following code in a UIViewController:

override func viewDidDisappear(_ animated: Bool) {
    super.viewDidDisappear(animated)
    viewModel.viewDidDisappear()
}

override func willMove(toParent parent: UIViewController?) { 
    super.willMove(toParent: parent)
    if parent == nil { //detect "Back" tapping
        viewModel.willMoveToParent()
    }
}

override func viewDidLoad() {
    super.viewDidLoad()
    configureUI(with: viewModel)
}

the type_contents_order is triggered in willMove(toParent:). This is a lifecycle method, so the rule should not be triggered.

Environment

  • SwiftLint version 0.42.0
  • Installation method used - CocoaPods
  • Xcode 12.2 (12B45b)
  • Configuration file:
opt_in_rules:
- type_contents_order

type_contents_order:
    excluded: ".*Tests\\.swift"
@kacper1703
Copy link
Author

Bumping the issue up :)

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