We expect to have a section in .cz.json looking like ``` { "commitizen": { "name": "cz_conventional_commits" } } ```
(self, data: bytes | str)
| 49 | return self |
| 50 | |
| 51 | def _parse_setting(self, data: bytes | str) -> None: |
| 52 | """We expect to have a section in .cz.json looking like |
| 53 | |
| 54 | ``` |
| 55 | { |
| 56 | "commitizen": { |
| 57 | "name": "cz_conventional_commits" |
| 58 | } |
| 59 | } |
| 60 | ``` |
| 61 | """ |
| 62 | try: |
| 63 | doc = json.loads(data) |
| 64 | except json.JSONDecodeError as e: |
| 65 | raise InvalidConfigurationError(f"Failed to parse {self.path}: {e}") |
| 66 | |
| 67 | try: |
| 68 | self.settings.update(doc["commitizen"]) |
| 69 | except KeyError: |
| 70 | pass |
no test coverage detected