Explicit Top Level ACL

Top-level declarations should specify Access Control Level keywords explicitly

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

Non Triggering Examples

internal enum A {}
public final class B {}
private struct S1 {
    struct S2 {}
}
internal enum A { enum B {} }
internal final actor Foo {}
internal typealias Foo = Bar
internal func a() {}
extension A: Equatable {}
extension A {}

Triggering Examples

enum A {}
final class B {}
protocol P {}
func a() {}
internal let a = 0
func b() {}