MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / check_cz_config

Function check_cz_config

tests/commands/test_init_command.py:156–166  ·  view source on GitHub ↗

Check the content of commitizen config is as expected

(config_filepath: str)

Source from the content-addressed store, hash-verified

154
155
156def check_cz_config(config_filepath: str):
157 """
158 Check the content of commitizen config is as expected
159 """
160 content = Path(config_filepath).read_text(encoding="utf-8")
161 if "json" in config_filepath:
162 assert json.loads(content) == EXPECTED_DICT_CONFIG
163 elif "yaml" in config_filepath:
164 assert yaml.load(content, Loader=yaml.FullLoader) == EXPECTED_DICT_CONFIG
165 else:
166 assert content == expected_config
167
168
169def check_pre_commit_config(expected: list[dict[str, Any]]):

Calls

no outgoing calls

Tested by

no test coverage detected