settings_write()
Write project settings.
With section, only that section of the active environment is
replaced. When the section is stored in a split file under settings/,
the values are merged into that file instead, under the section key the
file wraps its content in. The values may include that key
({"git": {...}}) or leave it out. Without section, the
whole file is replaced, wrapped in a default: environment.
Comments in a rewritten file are not kept.
Usage
settings_write(
values: Mapping[str, Any],
settings_file: str | Path | None = None,
section: str | None = None,
) -> None
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| values required | Mapping[str, Any] |
The settings to write. Without |
|
| settings_file | str | Path | None | None |
The settings file. Default: the settings.yml or config.yml found from the current directory, else |
| section | str | None | None |
The top-level section to replace, such as "directories", in the active environment ( |
Raises
SettingsError: Whensectionis given and the settings file or its split file does not exist.