Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lower_acl_than_parent not safe #4860

Closed
2 tasks done
paulo-bc opened this issue Apr 3, 2023 · 1 comment · Fixed by #4861
Closed
2 tasks done

lower_acl_than_parent not safe #4860

paulo-bc opened this issue Apr 3, 2023 · 1 comment · Fixed by #4861
Assignees
Labels
bug Unexpected and reproducible misbehavior.

Comments

@paulo-bc
Copy link

paulo-bc commented Apr 3, 2023

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) {}
}
@paulo-bc
Copy link
Author

paulo-bc commented Apr 3, 2023

An even simpler example

struct Example {
    public init() {}
}

gets corrected to

struct Example {init() {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants