no_grouping_extension - ApplebaumIan/BitbucketAPI GitHub Wiki

No Grouping Extension

Extensions shouldn't be used to group code within the same source file.

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

Non Triggering Examples

protocol Food {}
extension Food {}

class Apples {}
extension Oranges {}

class Box<T> {}
extension Box where T: Vegetable {}

Triggering Examples

enum Fruit {}
↓extension Fruit {}

↓extension Tea: Error {}
struct Tea {}

class Ham { class Spam {}}
↓extension Ham.Spam {}

extension External { struct Gotcha {}}
↓extension External.Gotcha {}