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

Function _initial

tests/conftest.py:102–120  ·  view source on GitHub ↗
(
        config_extra: str | None = None,
        version="0.1.0",
        initial_commit="feat: new user interface",
    )

Source from the content-addressed store, hash-verified

100 tmp_git_project: Path, util: UtilFixture, monkeypatch: pytest.MonkeyPatch
101):
102 def _initial(
103 config_extra: str | None = None,
104 version="0.1.0",
105 initial_commit="feat: new user interface",
106 ):
107 monkeypatch.chdir(tmp_git_project)
108 tmp_commitizen_cfg_file = tmp_git_project / "pyproject.toml"
109 tmp_commitizen_cfg_file.write_text(f'[tool.commitizen]\nversion="{version}"\n')
110 tmp_version_file = tmp_git_project / "__version__.py"
111 tmp_version_file.write_text(version)
112 tmp_version_file_string = str(tmp_version_file).replace("\\", "/")
113 with tmp_commitizen_cfg_file.open("a", encoding="utf-8") as f:
114 f.write(f'\nversion_files = ["{tmp_version_file_string}"]\n')
115 if config_extra:
116 with tmp_commitizen_cfg_file.open("a", encoding="utf-8") as f:
117 f.write(config_extra)
118 util.create_file_and_commit(initial_commit)
119
120 return tmp_git_project
121
122 return _initial
123

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…