realm / realm/SwiftLint

Feature request: allowFinal option on `explicit_top_level_acl` rule

Open
#4,833 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.