Add `ignore_first_metatype_parameter ` boolean option to `function_default_parameter_at_end`
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
- I've Updated SwiftLint to the latest version.
- I've searched for existing GitHub issues.
Feature or Enhancement Proposal
Please add a ignore_first_metatype_parameter boolean option to function_default_parameter_at_end that, when true, ignores the first metatype parameter (i.e. a parameter whose type is is *.Type; e.g., see this).
Metatype parameters with default arguments generally belong at the front of their parameter list due to English grammar, and they are frequent enough to warrant an ignore option.
Defaulting to false would mimic current behavior, but I bet it wouldn't be that bad to default to true, because that wouldn't generate false positives, and I doubt it would generate false negatives.
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
Locate the implementation and tests for the function_default_parameter_at_end rule, then inspect how its options and parameter types are handled. Add coverage for the ignore_first_metatype_parameter option, including its default behavior, and verify that a first *.Type parameter with a default argument is handled as specified.
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
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100