Fix parent-child scalar configuration inheritance - #6874
Draft
catlover-bot wants to merge 1 commit into
Draft
Conversation
Generated by 🚫 Danger |
Collaborator
|
This is not sufficient and leads to inconsistencies. Please check my last comment in #6240. |
catlover-bot
marked this pull request as draft
August 16, 2026 14:33
Author
|
Thanks for pointing this out. I agree that handling only I am moving this PR back to draft while reworking the change around a consistent parent/child merge policy. I have posted the proposed concept on #6240 before making the broader breaking change. |
catlover-bot
force-pushed
the
fix-allow-zero-lintable-files-parent-config
branch
from
August 16, 2026 15:58
5214e7f to
71e142f
Compare
This file contains hidden or 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
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.
Summary
Rework parent/child configuration merging so scalar options inherit the parent value when they are omitted from a parsed child configuration.
This implements the merge policy proposed in #6240 and discussed in #5724:
The affected options are:
indentationallow_zero_lintable_filesstrictlenientbaselinewrite_baselinecheck_for_updatesExplicit child values still override parent values, including explicit
falsevalues.Existing specialized behavior remains unchanged for:
included/excludedwarning_thresholdreportercache_pathreporterandcache_pathare intentionally left unchanged pending confirmation of the intended scope in #6240.Implementation
Parsed configurations track which inheritable scalar keys were explicitly specified.
During
merged(withChild:):The provenance metadata is not part of
Configurationequality or hashing because it is merge metadata rather than effective configuration state.Testing
parent_configandchild_configfile-level regression tests.swiftlint.ymlregression coverageConfigurationmerge behaviorswift test: 1093 tests in 374 suites passedswift build --product swiftlint: passedmake: passedgit diff --check: passedallow_zero_lintable_files: truedoesn't work when added to a parent config that's loaded by a child config #6240 with a parent settingallow_zero_lintable_files: true; lint now exits successfully with zero lintable filesThis PR remains a draft while confirming the final scope of the breaking configuration change.
Closes #6240
Related: #5724