You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 12, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 12, 2026. It is now read-only.
Flag redundant access levels same as enclosing context #1048
It would be great to flag code that is marked with an explicit access level (internal, private, fileprivate) that is redundant to the access level of the type that is enclosing that code.
I have already implemented this on a private branch - I'm just waiting to deal with #1042 before presenting this.
Not determined : Should this have its own flag? Or to avoid having too many new flags, could this feature be folded into an existing flag?
Here are some example of code that should be flagged. (The inner declarations, not the outer, and not the "(set)" specifiers)
private class Private {
private var x: Int
}
fileprivate class FilePrivate {
fileprivate var data: String = ""
fileprivate func method() {}
fileprivate struct Config {
fileprivate var value: Int = 0
}
}
internal class Internal {
internal var count: Int = 0
}
fileprivate class SetterExample {
fileprivate fileprivate(set) var redundantSetter: Int = 0
fileprivate private(set) var redundantAccess: Int = 0
}
internal class InternalSetterExample {
internal internal(set) var redundantBoth: Int = 0
fileprivate fileprivate(set) var redundantSetter: Int = 0
internal private(set) var redundantAccess: Int = 0
}
private class PrivateSetterExample {
private private(set) var redundantBoth: Int = 0
}
Periphery is moving to a commercial model, and issues are now handled in that repository. You can read about what's changing, and what it means for existing users, in A New Chapter.
Activity
ileitch commentedon Aug 12, 2026
This issue has been migrated to periphery-pro/issues#22 and is now tracked there.
Periphery is moving to a commercial model, and issues are now handled in that repository. You can read about what's changing, and what it means for existing users, in A New Chapter.