Parent config falsely reporting only_rules error when in child config
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
So we've got a parent config that has only_rules. That parent config configured rules that they did not put in only_rules. The parent config is not one we can choose.
Our child config uses opt_in_rules to enable what the parent configured. However SwiftLint reports:
Found a configuration for 'class_delegate_protocol' rule, but it is not present on 'only_rules'.
Now this is a true statement but the rule is enabled AND the configuration is adhered to. So the warning is giving superfluous information and cluttering our Xcode warnings.
PARENT:
only_rules:
- comma
colon:
severity: error
CHILD:
parent_config: url-to-parent-config-over-https
opt_in_rules:
- colon
Additional Context
- I do not have easy access to merely change the parent config, as it's owned by a different team.
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
Reproduce the report with the shown parent_config, only_rules, and opt_in_rules YAML, then trace how SwiftLint combines parent and child configuration. Verify the behavior around the class_delegate_protocol warning and confirm that a child-enabled rule with inherited configuration no longer produces the superfluous only_rules error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100