lower_acl_than_parent - ApplebaumIan/BitbucketAPI GitHub Wiki

Lower ACL than parent

Ensure definitions have a lower access control level than their enclosing parent

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

Non Triggering Examples

public struct Foo { public func bar() {} }
internal struct Foo { func bar() {} }
struct Foo { func bar() {} }
open class Foo { public func bar() {} }
open class Foo { open func bar() {} }
fileprivate struct Foo { private func bar() {} }
private struct Foo { private func bar(id: String) }
extension Foo { public func bar() {} }
private struct Foo { fileprivate func bar() {} }
private func foo(id: String) {}
private class Foo { func bar() {} }

Triggering Examples

struct Foo { public ↓func bar() {} }
enum Foo { public ↓func bar() {} }
public class Foo { open ↓func bar() }
class Foo { public private(set) ↓var bar: String? }
private class Foo { internal ↓func bar() {} }