Skip to content

lower_acl_than_parent not safe #4860

Closed
@paulo-bc

Description

New Issue Checklist

Describe the bug

Applying lower_acl_than_parent to provided sample code breaks it.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
Linting Swift files in current working directory
Linting 'Example.swift' (1/1)
/path/Example.swift:3:5: warning: Lower ACL than Parent Violation: Ensure declarations have a lower access control level than their enclosing parent (lower_acl_than_parent)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.51.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? homebrew
  • Paste your configuration file:
only_rules:
- lower_acl_than_parent
  • Are you using nested configurations? No.
  • Which Xcode version are you using (check xcodebuild -version)? Xcode 14.3 Build version 14E222b
  • Do you have a sample that shows the issue?
struct Example { 
    let content: String
    public init(content: String) {}
}

is corrected to:

struct Example { 
    let content: Stringinit(content: String) {}
}

Metadata

Assignees

Labels

bugUnexpected and reproducible misbehavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions