-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabled rules in child configs are no longer automatically ignored if they are opt-in #4863
Merged
SimplyDanny
merged 27 commits into
realm:main
from
mildm8nnered:mildm8nnered-fix-disabled-rules-in-child-config
Jul 26, 2023
Merged
Disabled rules in child configs are no longer automatically ignored if they are opt-in #4863
SimplyDanny
merged 27 commits into
realm:main
from
mildm8nnered:mildm8nnered-fix-disabled-rules-in-child-config
Jul 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generated by 🚫 Danger |
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
from
April 5, 2023 22:38
c4c2571
to
ac7a69a
Compare
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
4 times, most recently
from
April 19, 2023 23:08
a5b6e05
to
843ab68
Compare
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
2 times, most recently
from
April 27, 2023 21:39
b66bc90
to
faab0f7
Compare
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
from
May 30, 2023 21:05
faab0f7
to
51e9533
Compare
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
3 times, most recently
from
June 24, 2023 11:19
c075dd7
to
e8e4b46
Compare
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
from
June 27, 2023 08:21
e8e4b46
to
e70f529
Compare
SimplyDanny
reviewed
Jun 27, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me! However, I'm having a hard time following the tests. 🫣
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
2 times, most recently
from
July 7, 2023 17:02
fca516a
to
112bdcd
Compare
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
4 times, most recently
from
July 19, 2023 18:13
c360b55
to
bb848df
Compare
SimplyDanny
approved these changes
Jul 23, 2023
Tests/SwiftLintFrameworkTests/ConfigurationTests+MultipleConfigs.swift
Outdated
Show resolved
Hide resolved
…e Equatable yet, despite SE-0283
mildm8nnered
force-pushed
the
mildm8nnered-fix-disabled-rules-in-child-config
branch
from
July 25, 2023 01:53
4666fe2
to
0932089
Compare
SimplyDanny
reviewed
Jul 25, 2023
Thanks for all the effort, @mildm8nnered! |
mildm8nnered
deleted the
mildm8nnered-fix-disabled-rules-in-child-config
branch
October 1, 2023 10:42
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes some unexpected behaviors in the interaction between parent and child configurations.
For example, if a rule is enabled and disabled in the parent config, and not mentioned in the child config (case 3 below), currently the rule will become re-enabled in the merged configuration.
Resolves #4876, which documents the unexpected behaviors.
Below is the truth table for whether an optin rule is enabled in the child configuration, as a function of whether it is listed in the
opt_in_rules
, and/or thedisabled_rules
sections of the parent and child configuration.current
is the value formain
/0.51.0
, andnew
is the value produced by this branch.asterisked rows have changed.
To take case 3 in detail, if an optin rule is listed in opt_in_rules and disabled_rules in the parent configuration, and not mentioned in the child, then currently (in
main
/0.51.0
) the rule will be disabled for the parent configuration, but enabled in the child.parent.yml:
child.yml:
checking enablement:
and actual behaviour, given:
Similarly, in cases 12 through 15, the rule is both mentioned in the child's
opt_in_rules
, anddisabled_rules
, which should surely mean the rule ends up disabled in the child, no matter what the parent says.This PR changes the processing of these configurations, to produce the truth values shown in the
new
column above, which seem more sensible than the current values.There is a related issue when the parent has only rules, and the child has a default configuration.
Here is the truth table for this case:
Examining case 3
parent.yml:
and child.yml:
Currently (in
main
/0.51.0
) the rule would end up enabled for the child, even though it is explicitly disabled in the child configuration.