Feature Request: line_length ignore "localize(d)" lines.
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
NSLocalizedString & family of methods / macros, and custom-prefixed versions of those can easily get very long, and it doesn't usually provide additional value to the readability of the code to force-wrapping on them.
Proposals
A. provide an option like "ignores_localizable_content" that will ignore lines that contain the substring "localize" (case insensitive).
B. provide an option like "replacement_regexp_for_length_testing" -- if the user supplies this, then they can cause that regexp be used to modify overly long lines and see if they still hit the limits.
C. Both options A & B
Option A. has the benefit of being comparatively easy to implement, but can lead to permitting ridiculously easy to have long lines because there was a localized string as one of the args.
Option B. solves for the problem in A, as well as being more flexible for large codebases, but requires user education.
Option C. can be implemented by implementing A on top of option B.
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
The issue does not name files, tests, or an entry point. Start by locating the existing line_length rule and its configuration, then resolve whether the intended scope is option A, B, or C; done means the selected behavior is implemented and covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100