We expect to have a section in cz.yaml looking like ``` commitizen: name: cz_conventional_commits ```
(self, data: bytes | str)
| 38 | return config_doc is not None and config_doc.get("commitizen") is not None |
| 39 | |
| 40 | def _parse_setting(self, data: bytes | str) -> None: |
| 41 | """We expect to have a section in cz.yaml looking like |
| 42 | |
| 43 | ``` |
| 44 | commitizen: |
| 45 | name: cz_conventional_commits |
| 46 | ``` |
| 47 | """ |
| 48 | try: |
| 49 | doc = yaml.safe_load(data) |
| 50 | except yaml.YAMLError as e: |
| 51 | raise InvalidConfigurationError(f"Failed to parse {self.path}: {e}") |
| 52 | |
| 53 | try: |
| 54 | self.settings.update(doc["commitizen"]) |
| 55 | except (KeyError, TypeError): |
| 56 | pass |
| 57 | |
| 58 | def set_key(self, key: str, value: object) -> Self: |
| 59 | with self.path.open("rb") as yaml_file: |
no test coverage detected