legacy_constant - ApplebaumIan/BitbucketAPI GitHub Wiki

Legacy Constant

Struct-scoped constants are preferred over legacy global constants.

  • Identifier: legacy_constant
  • Enabled by default: Enabled
  • Supports autocorrection: Yes
  • Kind: idiomatic
  • Analyzer rule: No
  • Minimum Swift compiler version: 3.0.0
  • Default configuration: warning

Non Triggering Examples

CGRect.infinite
CGPoint.zero
CGRect.zero
CGSize.zero
NSPoint.zero
NSRect.zero
NSSize.zero
CGRect.null
CGFloat.pi
Float.pi

Triggering Examples

↓CGRectInfinite
↓CGPointZero
↓CGRectZero
↓CGSizeZero
↓NSZeroPoint
↓NSZeroRect
↓NSZeroSize
↓CGRectNull
↓CGFloat(M_PI)
↓Float(M_PI)