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

Method _parse_setting

commitizen/config/toml_config.py:54–70  ·  view source on GitHub ↗

We expect to have a section in pyproject looking like ``` [tool.commitizen] name = "cz_conventional_commits" ```

(self, data: bytes | str)

Source from the content-addressed store, hash-verified

52 return self
53
54 def _parse_setting(self, data: bytes | str) -> None:
55 """We expect to have a section in pyproject looking like
56
57 ```
58 [tool.commitizen]
59 name = "cz_conventional_commits"
60 ```
61 """
62 try:
63 doc = parse(data)
64 except exceptions.ParseError as e:
65 raise InvalidConfigurationError(f"Failed to parse {self.path}: {e}")
66
67 try:
68 self.settings.update(doc["tool"]["commitizen"]) # type: ignore[index,typeddict-item] # TODO: fix this
69 except exceptions.NonExistentKey:
70 pass

Callers 1

__init__Method · 0.95

Calls 2

updateMethod · 0.80

Tested by

no test coverage detected