Feature request: allowFinal option on `explicit_top_level_acl` rule
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Describe the bug
In my codebase, top level declarations typically look like, in order of decreasing frequency:
internal final xxx - internal and cannot be subclassed at all
public xxx - public and can only be subclassed within its module
internal xxx - internal and can be subclassed within its module
open xxx - public and can be subclassed outside its module
Where xxx is class, struct, enum, etc.
I would like to keep requiring top level acl, but in the case of internal final xxx, which is overwhelmingly the most common case in my codebase, I would like to accept final xxx. An allowFinal option on explicit_top_level_acl, defaulting to false would be handy for my case.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the explicit_top_level_acl rule and its existing configuration and test entry points. Add an allowFinal option that defaults to false, and verify that final top-level declarations are accepted only when the option is enabled while current behavior remains unchanged by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100