Self Binding

Re-bind self to a consistent identifier name.

  • Identifier: self_binding
  • Enabled by default: No
  • Supports autocorrection: Yes
  • Kind: style
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity warning
    bind_identifier “self”

Non Triggering Examples

if let self = self { return }
guard let self = self else { return }
if let this = this { return }
guard let this = this else { return }
if let this = self { return }
guard let this = self else { return }

Triggering Examples

if let `self` = self { return }
guard let `self` = self else { return }
if let this = self { return }
guard let this = self else { return }
if let self = self { return }
guard let self = self else { return }
if let self { return }
guard let self else { return }