MCPcopy Index your code
hub / github.com/commitizen-tools/commitizen / set_key

Method set_key

commitizen/config/yaml_config.py:58–68  ·  view source on GitHub ↗
(self, key: str, value: object)

Source from the content-addressed store, hash-verified

56 pass
57
58 def set_key(self, key: str, value: object) -> Self:
59 with self.path.open("rb") as yaml_file:
60 config_doc = yaml.load(yaml_file, Loader=yaml.FullLoader)
61
62 config_doc["commitizen"][key] = value
63 with smart_open(
64 self.path, "w", encoding=self._settings["encoding"]
65 ) as yaml_file:
66 yaml.dump(config_doc, yaml_file, explicit_start=True)
67
68 return self

Callers

nothing calls this directly

Calls 1

smart_openFunction · 0.90

Tested by

no test coverage detected