commitizen 4.11.4__tar.gz → 4.11.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {commitizen-4.11.4 → commitizen-4.11.5}/PKG-INFO +1 -1
- commitizen-4.11.5/commitizen/__version__.py +1 -0
- commitizen-4.11.5/commitizen/config/__init__.py +64 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/defaults.py +4 -4
- {commitizen-4.11.4 → commitizen-4.11.5}/pyproject.toml +1 -1
- commitizen-4.11.4/commitizen/__version__.py +0 -1
- commitizen-4.11.4/commitizen/config/__init__.py +0 -62
- {commitizen-4.11.4 → commitizen-4.11.5}/LICENSE +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/__init__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/__main__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/bump.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/changelog.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/changelog_formats/__init__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/changelog_formats/asciidoc.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/changelog_formats/base.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/changelog_formats/markdown.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/changelog_formats/restructuredtext.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/changelog_formats/textile.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cli.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cmd.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/__init__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/bump.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/changelog.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/check.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/commit.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/example.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/info.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/init.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/list_cz.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/schema.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/commands/version.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/config/base_config.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/config/factory.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/config/json_config.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/config/toml_config.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/config/yaml_config.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/__init__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/base.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/conventional_commits/__init__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/conventional_commits/conventional_commits.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/conventional_commits/conventional_commits_info.txt +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/customize/__init__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/customize/customize.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/customize/customize_info.txt +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/exceptions.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/jira/__init__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/jira/jira.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/jira/jira_info.txt +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/utils.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/exceptions.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/factory.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/git.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/hooks.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/out.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/project_info.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/__init__.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/base_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/cargo_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/commitizen_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/composer_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/npm_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/pep621_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/poetry_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/scm_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/providers/uv_provider.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/py.typed +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/question.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/tags.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/templates/CHANGELOG.adoc.j2 +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/templates/CHANGELOG.md.j2 +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/templates/CHANGELOG.rst.j2 +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/templates/CHANGELOG.textile.j2 +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/commitizen/version_schemes.py +0 -0
- {commitizen-4.11.4 → commitizen-4.11.5}/docs/README.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "4.11.5"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from commitizen import defaults, git, out
|
|
6
|
+
from commitizen.config.factory import create_config
|
|
7
|
+
from commitizen.exceptions import ConfigFileIsEmpty, ConfigFileNotFound
|
|
8
|
+
|
|
9
|
+
from .base_config import BaseConfig
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _resolve_config_paths() -> list[Path]:
|
|
13
|
+
git_project_root = git.find_git_project_root()
|
|
14
|
+
cfg_search_paths = [Path(".")]
|
|
15
|
+
|
|
16
|
+
if git_project_root and not cfg_search_paths[0].samefile(git_project_root):
|
|
17
|
+
cfg_search_paths.append(git_project_root)
|
|
18
|
+
|
|
19
|
+
# The following algorithm is ugly, but we need to ensure that the order of the candidates are preserved before v5.
|
|
20
|
+
# Also, the number of possible config files is limited, so the complexity is not a problem.
|
|
21
|
+
candidates: list[Path] = []
|
|
22
|
+
for dir in cfg_search_paths:
|
|
23
|
+
for filename in defaults.CONFIG_FILES:
|
|
24
|
+
out_path = dir / Path(filename)
|
|
25
|
+
if out_path.exists() and all(not out_path.samefile(p) for p in candidates):
|
|
26
|
+
candidates.append(out_path)
|
|
27
|
+
return candidates
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _create_config_from_path(path: Path) -> BaseConfig:
|
|
31
|
+
with open(path, "rb") as f:
|
|
32
|
+
data: bytes = f.read()
|
|
33
|
+
|
|
34
|
+
return create_config(data=data, path=path)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def read_cfg(filepath: str | None = None) -> BaseConfig:
|
|
38
|
+
if filepath is not None:
|
|
39
|
+
conf_path = Path(filepath)
|
|
40
|
+
if not conf_path.exists():
|
|
41
|
+
raise ConfigFileNotFound()
|
|
42
|
+
conf = _create_config_from_path(conf_path)
|
|
43
|
+
if conf.is_empty_config:
|
|
44
|
+
raise ConfigFileIsEmpty()
|
|
45
|
+
return conf
|
|
46
|
+
|
|
47
|
+
config_candidate_paths = _resolve_config_paths()
|
|
48
|
+
|
|
49
|
+
# Check for multiple config files and warn the user
|
|
50
|
+
config_candidates_exclude_pyproject = [
|
|
51
|
+
path for path in config_candidate_paths if path.name != "pyproject.toml"
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
for config_candidate_path in config_candidate_paths:
|
|
55
|
+
conf = _create_config_from_path(config_candidate_path)
|
|
56
|
+
if not conf.is_empty_config:
|
|
57
|
+
if len(config_candidates_exclude_pyproject) > 1:
|
|
58
|
+
out.warn(
|
|
59
|
+
f"Multiple config files detected: {', '.join(map(str, config_candidates_exclude_pyproject))}. "
|
|
60
|
+
f"Using config file: '{config_candidate_path}'."
|
|
61
|
+
)
|
|
62
|
+
return conf
|
|
63
|
+
|
|
64
|
+
return BaseConfig()
|
|
@@ -67,15 +67,15 @@ class Settings(TypedDict, total=False):
|
|
|
67
67
|
breaking_change_exclamation_in_title: bool
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
CONFIG_FILES:
|
|
71
|
-
"pyproject.toml",
|
|
70
|
+
CONFIG_FILES: tuple[str, ...] = (
|
|
72
71
|
".cz.toml",
|
|
72
|
+
"cz.toml",
|
|
73
73
|
".cz.json",
|
|
74
74
|
"cz.json",
|
|
75
75
|
".cz.yaml",
|
|
76
76
|
"cz.yaml",
|
|
77
|
-
"
|
|
78
|
-
|
|
77
|
+
"pyproject.toml",
|
|
78
|
+
)
|
|
79
79
|
ENCODING = "utf-8"
|
|
80
80
|
|
|
81
81
|
DEFAULT_SETTINGS: Settings = {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "4.11.4"
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
from typing import TYPE_CHECKING
|
|
5
|
-
|
|
6
|
-
from commitizen import defaults, git, out
|
|
7
|
-
from commitizen.config.factory import create_config
|
|
8
|
-
from commitizen.exceptions import ConfigFileIsEmpty, ConfigFileNotFound
|
|
9
|
-
|
|
10
|
-
from .base_config import BaseConfig
|
|
11
|
-
|
|
12
|
-
if TYPE_CHECKING:
|
|
13
|
-
from collections.abc import Generator
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def _resolve_config_paths(filepath: str | None = None) -> Generator[Path, None, None]:
|
|
17
|
-
if filepath is not None:
|
|
18
|
-
out_path = Path(filepath)
|
|
19
|
-
if not out_path.exists():
|
|
20
|
-
raise ConfigFileNotFound()
|
|
21
|
-
|
|
22
|
-
yield out_path
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
git_project_root = git.find_git_project_root()
|
|
26
|
-
cfg_search_paths = [Path(".")]
|
|
27
|
-
if git_project_root:
|
|
28
|
-
cfg_search_paths.append(git_project_root)
|
|
29
|
-
|
|
30
|
-
for path in cfg_search_paths:
|
|
31
|
-
for filename in defaults.CONFIG_FILES:
|
|
32
|
-
out_path = path / Path(filename)
|
|
33
|
-
if out_path.exists():
|
|
34
|
-
yield out_path
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def read_cfg(filepath: str | None = None) -> BaseConfig:
|
|
38
|
-
config_candidates = list(_resolve_config_paths(filepath))
|
|
39
|
-
|
|
40
|
-
# Check for multiple config files and warn the user
|
|
41
|
-
config_candidates_exclude_pyproject = [
|
|
42
|
-
path for path in config_candidates if path.name != "pyproject.toml"
|
|
43
|
-
]
|
|
44
|
-
if len(config_candidates_exclude_pyproject) > 1:
|
|
45
|
-
filenames = [path.name for path in config_candidates_exclude_pyproject]
|
|
46
|
-
out.warn(
|
|
47
|
-
f"Multiple config files detected: {', '.join(filenames)}. "
|
|
48
|
-
f"Using config file: '{filenames[0]}'."
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
for filename in config_candidates:
|
|
52
|
-
with open(filename, "rb") as f:
|
|
53
|
-
data: bytes = f.read()
|
|
54
|
-
|
|
55
|
-
conf = create_config(data=data, path=filename)
|
|
56
|
-
if not conf.is_empty_config:
|
|
57
|
-
return conf
|
|
58
|
-
|
|
59
|
-
if filepath is not None:
|
|
60
|
-
raise ConfigFileIsEmpty()
|
|
61
|
-
|
|
62
|
-
return BaseConfig()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{commitizen-4.11.4 → commitizen-4.11.5}/commitizen/cz/conventional_commits/conventional_commits.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|