{{ message }}
Repository navigation
fix: inherit the ancestor config in a main config with "inherit": true - #1340
Merged
Merged
Conversation
…erit from the global config file
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.

A config file with
"inherit": truewas only merged with its ancestor config when it was discovered as a descendant of the config file the CLI started with. When it was the main config (the one found from the cwd),inheritwas ignored, so runningdprint fmtin./sub-projectused different configuration than running it in the root directory, anddprint installthere didn't install the inherited plugins. The language server already inherited in this case.This makes
"inherit": truework one way everywhere (CLI, editor service, and language server), all going through the same code:"inherit": truealways inherits from the closest config file in the ancestor directories of that file (which may also inherit). It's an error when there isn't one."inherit": true, and the global config file is never inherited from."inherit": truehas no ancestor directories, so the property is ignored with a warning (shown on the first download, like theincludesone).This applies to the main config file, a config file specified via
--config, a config file in a descendant directory, a config file found for a path outside the cwd, and a config file pulled in viaextends.Behaviour changes
"inherit": trueand no config file in an ancestor directory is now an error. Previously this was silently ignored.--configinherits from the ancestor directories of that file, including with--config-discovery=false. Previously it was used on its own in the language server and never inherited in the CLI.--configis used, where it previously inherited from the specified config file."inherit": truein a local config file that's extended now has that file inherit from the config file in its ancestor directories, at a lower precedence than what the file extends. Previouslyinheritwas left as an unknown property. A circular inherit this makes possible is an error.When the global config file gets used (no config file in the directory) is unchanged.
Notes
dprint addanddprint config updatenow see the inherited plugins of the main config, the same way they already see plugins fromextendsand from descendant configs that inherit.