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

Function _resolve_config_candidates

commitizen/config/__init__.py:12–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def _resolve_config_candidates() -> list[BaseConfig]:
13 git_project_root = git.find_git_project_root()
14 cfg_search_paths = [Path(".")]
15
16 if git_project_root and cfg_search_paths[0].resolve() != git_project_root.resolve():
17 cfg_search_paths.append(git_project_root)
18
19 candidates: list[BaseConfig] = []
20 for dir in cfg_search_paths:
21 for filename in defaults.CONFIG_FILES:
22 out_path = dir / filename
23 if out_path.is_file():
24 conf = _create_config_from_path(out_path)
25 if conf.contains_commitizen_section():
26 candidates.append(conf)
27 return candidates
28
29
30def _create_config_from_path(path: Path) -> BaseConfig:

Callers 1

read_cfgFunction · 0.85

Calls 2

_create_config_from_pathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…