SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

Unintuitive behavior for parent and child configurations w.r.t. implicit overwrites

Open SimplyDanny opened this issue 1 year ago • 1 comments

All options possible in a configuration have a default value which is implicitly set even if an option is not mentioned in a certain configuration. Together with the rule that child configurations specialize parent configurations, all options set in the parent are overridden by the values in the child even if they are not explicitly set therein.

One example is strict which is false by default. Setting strict: true in the parent, but not mentioning it at all in the child resets it to its default value false. This is most likely not the intention of the user.

We should change the behavior to something more intuitive. This would definitely be a breaking change which needs to be properly communicated. The new logic must be well thought out and needs to consider parent_config and child_config.

SimplyDanny avatar Aug 03 '24 15:08 SimplyDanny

Without having thought about it too much, I guess something like parent takes precedence over the default - i.e. the child wins, but only for things it sets explicitly.

Somewhat tangentially, it would be really nice to have some way to easily define command line options and config file equivalents.

mildm8nnered avatar Aug 04 '24 02:08 mildm8nnered