Period Spacing

Periods should not be followed by more than one space

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

Non Triggering Examples

let pi = 3.2
let pi = Double.pi
let pi = Double. pi
let pi = Double.  pi
// A. Single.
///   - code: Identifier of the error. Integer.
// value: Multiline.
//        Comment.
/**
Sentence ended in period.

- Sentence 2 new line characters after.
**/

Triggering Examples

/* Only god knows why. ↓ This symbol does nothing. */
// Only god knows why. ↓ This symbol does nothing.
// Single. Double. ↓ End.
// Single. Double. ↓ Triple. ↓  End.
// Triple. ↓  Quad. ↓   End.
///   - code: Identifier of the error. ↓ Integer.