Skip to content
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

Configuration files should be merged hierarchically #3420

Closed
charliermarsh opened this issue May 7, 2024 · 0 comments · Fixed by #3462
Closed

Configuration files should be merged hierarchically #3420

charliermarsh opened this issue May 7, 2024 · 0 comments · Fixed by #3462
Assignees
Labels
configuration Settings and such preview Experimental behavior

Comments

@charliermarsh
Copy link
Member

Following Cargo's strategy here: https://doc.rust-lang.org/cargo/reference/config.html.

We should at least merge the local configuration with the user configuration (e.g., our $HOME/.cargo/config.toml equivalent). We can probably skip merging configuration all along the path.

@charliermarsh charliermarsh added configuration Settings and such preview Experimental behavior labels May 7, 2024
@charliermarsh charliermarsh self-assigned this May 8, 2024
charliermarsh added a commit that referenced this issue May 8, 2024
## Summary

This PR follows Cargo's strategy for merging configuration, albeit in a
more limited way (we don't support as many configuration locations).
Specifically, we merge the user configuration with the workspace
configuration if both are present. The workspace configuration has
priority, such that we take values from the workspace configuration and
ignore those in the user configuration if both are specified for a given
setting -- with the exception of arrays and maps, which are
concatenated.

For now, if a user provides a configuration file with `--config-file`,
we _don't_ merge in the user settings.

See:
https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure.

Closes #3420.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Settings and such preview Experimental behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant