commitizen 3.10.0__tar.gz → 3.11.0__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-3.10.0 → commitizen-3.11.0}/PKG-INFO +1 -1
- commitizen-3.11.0/commitizen/__version__.py +1 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/bump.py +5 -4
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cli.py +25 -2
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/commit.py +7 -2
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/defaults.py +1 -1
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/git.py +3 -1
- {commitizen-3.10.0 → commitizen-3.11.0}/pyproject.toml +5 -5
- {commitizen-3.10.0 → commitizen-3.11.0}/setup.py +1 -1
- commitizen-3.10.0/commitizen/__version__.py +0 -1
- {commitizen-3.10.0 → commitizen-3.11.0}/LICENSE +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/__init__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/__main__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/changelog.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/changelog_parser.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cmd.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/__init__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/bump.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/changelog.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/check.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/example.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/info.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/init.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/list_cz.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/schema.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/commands/version.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/config/__init__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/config/base_config.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/config/json_config.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/config/toml_config.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/config/yaml_config.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/__init__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/base.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/conventional_commits/__init__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/conventional_commits/conventional_commits.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/conventional_commits/conventional_commits_info.txt +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/customize/__init__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/customize/customize.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/customize/customize_info.txt +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/exceptions.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/jira/__init__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/jira/jira.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/jira/jira_info.txt +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/cz/utils.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/exceptions.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/factory.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/hooks.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/out.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/__init__.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/base_provider.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/cargo_provider.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/commitizen_provider.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/composer_provider.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/npm_provider.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/pep621_provider.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/poetry_provider.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/providers/scm_provider.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/templates/keep_a_changelog_template.j2 +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/commitizen/version_schemes.py +0 -0
- {commitizen-3.10.0 → commitizen-3.11.0}/docs/README.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "3.11.0"
|
|
@@ -10,6 +10,8 @@ from commitizen.exceptions import CurrentVersionNotFoundError
|
|
|
10
10
|
from commitizen.git import GitCommit, smart_open
|
|
11
11
|
from commitizen.version_schemes import DEFAULT_SCHEME, Version, VersionScheme
|
|
12
12
|
|
|
13
|
+
VERSION_TYPES = [None, PATCH, MINOR, MAJOR]
|
|
14
|
+
|
|
13
15
|
|
|
14
16
|
def find_increment(
|
|
15
17
|
commits: list[GitCommit], regex: str, increments_map: dict | OrderedDict
|
|
@@ -34,12 +36,11 @@ def find_increment(
|
|
|
34
36
|
new_increment = increments_map[match_pattern]
|
|
35
37
|
break
|
|
36
38
|
|
|
39
|
+
if VERSION_TYPES.index(increment) < VERSION_TYPES.index(new_increment):
|
|
40
|
+
increment = new_increment
|
|
41
|
+
|
|
37
42
|
if increment == MAJOR:
|
|
38
43
|
break
|
|
39
|
-
elif increment == MINOR and new_increment == MAJOR:
|
|
40
|
-
increment = new_increment
|
|
41
|
-
elif increment == PATCH or increment is None:
|
|
42
|
-
increment = new_increment
|
|
43
44
|
|
|
44
45
|
return increment
|
|
45
46
|
|
|
@@ -15,6 +15,7 @@ from commitizen.exceptions import (
|
|
|
15
15
|
CommitizenException,
|
|
16
16
|
ExitCode,
|
|
17
17
|
ExpectedExit,
|
|
18
|
+
InvalidCommandArgumentError,
|
|
18
19
|
NoCommandFoundError,
|
|
19
20
|
)
|
|
20
21
|
|
|
@@ -441,7 +442,7 @@ def main():
|
|
|
441
442
|
|
|
442
443
|
# This is for the command required constraint in 2.0
|
|
443
444
|
try:
|
|
444
|
-
args = parser.
|
|
445
|
+
args, unknown_args = parser.parse_known_args()
|
|
445
446
|
except (TypeError, SystemExit) as e:
|
|
446
447
|
# https://github.com/commitizen-tools/commitizen/issues/429
|
|
447
448
|
# argparse raises TypeError when non exist command is provided on Python < 3.9
|
|
@@ -450,6 +451,28 @@ def main():
|
|
|
450
451
|
raise NoCommandFoundError()
|
|
451
452
|
raise e
|
|
452
453
|
|
|
454
|
+
arguments = vars(args)
|
|
455
|
+
if unknown_args:
|
|
456
|
+
# Raise error for extra-args without -- separation
|
|
457
|
+
if "--" not in unknown_args:
|
|
458
|
+
raise InvalidCommandArgumentError(
|
|
459
|
+
f"Invalid commitizen arguments were found: `{' '.join(unknown_args)}`. "
|
|
460
|
+
"Please use -- separator for extra git args"
|
|
461
|
+
)
|
|
462
|
+
# Raise error for extra-args before --
|
|
463
|
+
elif unknown_args[0] != "--":
|
|
464
|
+
pos = unknown_args.index("--")
|
|
465
|
+
raise InvalidCommandArgumentError(
|
|
466
|
+
f"Invalid commitizen arguments were found before -- separator: `{' '.join(unknown_args[:pos])}`. "
|
|
467
|
+
)
|
|
468
|
+
# Log warning for -- without any extra args
|
|
469
|
+
elif len(unknown_args) == 1:
|
|
470
|
+
logger.warning(
|
|
471
|
+
"\nWARN: Incomplete commit command: received -- separator without any following git arguments\n"
|
|
472
|
+
)
|
|
473
|
+
extra_args = " ".join(unknown_args[1:])
|
|
474
|
+
arguments["extra_cli_args"] = extra_args
|
|
475
|
+
|
|
453
476
|
if args.name:
|
|
454
477
|
conf.update({"name": args.name})
|
|
455
478
|
elif not args.name and not conf.path:
|
|
@@ -465,7 +488,7 @@ def main():
|
|
|
465
488
|
)
|
|
466
489
|
sys.excepthook = no_raise_debug_excepthook
|
|
467
490
|
|
|
468
|
-
args.func(conf,
|
|
491
|
+
args.func(conf, arguments)()
|
|
469
492
|
|
|
470
493
|
|
|
471
494
|
if __name__ == "__main__":
|
|
@@ -98,9 +98,14 @@ class Commit:
|
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
if signoff:
|
|
101
|
-
|
|
101
|
+
out.warn(
|
|
102
|
+
"signoff mechanic is deprecated, please use `cz commit -- -s` instead."
|
|
103
|
+
)
|
|
104
|
+
extra_args = self.arguments.get("extra_cli_args", "--") + " -s"
|
|
102
105
|
else:
|
|
103
|
-
|
|
106
|
+
extra_args = self.arguments.get("extra_cli_args", "")
|
|
107
|
+
|
|
108
|
+
c = git.commit(m, args=extra_args)
|
|
104
109
|
|
|
105
110
|
if c.return_code != 0:
|
|
106
111
|
out.error(c.err)
|
|
@@ -104,7 +104,7 @@ MAJOR = "MAJOR"
|
|
|
104
104
|
MINOR = "MINOR"
|
|
105
105
|
PATCH = "PATCH"
|
|
106
106
|
|
|
107
|
-
bump_pattern = r"^((
|
|
107
|
+
bump_pattern = r"^((BREAKING[\-\ ]CHANGE|\w+)(\(.+\))?!?):"
|
|
108
108
|
bump_map = OrderedDict(
|
|
109
109
|
(
|
|
110
110
|
(r"^.+!$", MAJOR),
|
|
@@ -98,7 +98,9 @@ def add(args: str = "") -> cmd.Command:
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
def commit(
|
|
101
|
-
message: str,
|
|
101
|
+
message: str,
|
|
102
|
+
args: str = "",
|
|
103
|
+
committer_date: str | None = None,
|
|
102
104
|
) -> cmd.Command:
|
|
103
105
|
f = NamedTemporaryFile("wb", delete=False)
|
|
104
106
|
f.write(message.encode("utf-8"))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[tool.commitizen]
|
|
2
|
-
version = "3.
|
|
2
|
+
version = "3.11.0"
|
|
3
3
|
tag_format = "v$version"
|
|
4
4
|
version_files = [
|
|
5
5
|
"pyproject.toml:version",
|
|
@@ -9,7 +9,7 @@ version_files = [
|
|
|
9
9
|
|
|
10
10
|
[tool.poetry]
|
|
11
11
|
name = "commitizen"
|
|
12
|
-
version = "3.
|
|
12
|
+
version = "3.11.0"
|
|
13
13
|
description = "Python commitizen client tool"
|
|
14
14
|
authors = ["Santiago Fraire <santiwilly@gmail.com>"]
|
|
15
15
|
license = "MIT"
|
|
@@ -58,10 +58,10 @@ pytest-regressions = "^2.4.0"
|
|
|
58
58
|
pytest-freezer = "^0.4.6"
|
|
59
59
|
pytest-xdist = "^3.1.0"
|
|
60
60
|
# code formatter
|
|
61
|
-
black = "
|
|
61
|
+
black = ">=22.10,<24.0"
|
|
62
62
|
# linter
|
|
63
|
-
ruff = ">=0.0.275,<0.0.
|
|
64
|
-
pre-commit = "
|
|
63
|
+
ruff = ">=0.0.275,<0.0.293"
|
|
64
|
+
pre-commit = ">=2.18,<4.0"
|
|
65
65
|
mypy = "^1.4"
|
|
66
66
|
types-PyYAML = ">=5.4.3,<7.0.0"
|
|
67
67
|
types-termcolor = "^0.1.1"
|
|
@@ -50,7 +50,7 @@ entry_points = \
|
|
|
50
50
|
|
|
51
51
|
setup_kwargs = {
|
|
52
52
|
'name': 'commitizen',
|
|
53
|
-
'version': '3.
|
|
53
|
+
'version': '3.11.0',
|
|
54
54
|
'description': 'Python commitizen client tool',
|
|
55
55
|
'long_description': '[](https://github.com/commitizen-tools/commitizen/actions)\n[](https://conventionalcommits.org)\n[](https://pypi.org/project/commitizen/)\n[](https://pypi.org/project/commitizen/)\n[](https://pypi.org/project/commitizen/)\n[](https://formulae.brew.sh/formula/commitizen)\n[](https://codecov.io/gh/commitizen-tools/commitizen)\n[](https://github.com/pre-commit/pre-commit)\n\n\n\n---\n\n**Documentation:** [https://commitizen-tools.github.io/commitizen/](https://commitizen-tools.github.io/commitizen/)\n\n---\n\n## About\n\nCommitizen is release management tool designed for teams.\n\nCommitizen assumes your team uses a standard way of committing rules\nand from that foundation, it can bump your project\'s version, create\nthe changelog, and update files.\n\nBy default, commitizen uses [conventional commits][conventional_commits], but you\ncan build your own set of rules, and publish them.\n\nUsing a standardized set of rules to write commits, makes commits easier to read, and enforces writing\ndescriptive commits.\n\n### Features\n\n- Command-line utility to create commits with your rules. Defaults: [Conventional commits][conventional_commits]\n- Bump version automatically using [semantic versioning][semver] based on the commits. [Read More](./bump.md)\n- Generate a changelog using [Keep a changelog][keepchangelog]\n- Update your project\'s version files automatically\n- Display information about your commit rules (commands: schema, example, info)\n- Create your own set of rules and publish them to pip. Read more on [Customization](./customization.md)\n\n## Requirements\n\n[Python](https://www.python.org/downloads/) `3.8+`\n\n[Git][gitscm] `1.8.5.2+`\n\n## Installation\n\nTo make commitizen available in your system\n\n```bash\npip install --user -U Commitizen\n```\n\n### Python project\n\nYou can add it to your local project using one of these:\n\n```bash\npip install -U commitizen\n```\n\nfor Poetry >= 1.2.0:\n\n```bash\npoetry add commitizen --group dev\n```\n\nfor Poetry < 1.2.0:\n\n```bash\npoetry add commitizen --dev\n```\n\n### macOS\n\nvia [homebrew](https://formulae.brew.sh/formula/commitizen):\n\n```bash\nbrew install commitizen\n```\n\n## Usage\n\nMost of the time this is the only command you\'ll run:\n\n```sh\ncz bump\n```\n\nOn top of that, you can use commitizen to assist you with the creation of commits:\n\n```sh\ncz commit\n```\n\nRead more in the section [Getting Started](./getting_started.md).\n\n### Help\n\n```sh\n$ cz --help\nusage: cz [-h] [--debug] [-n NAME] [-nr NO_RAISE] {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} ...\n\nCommitizen is a cli tool to generate conventional commits.\nFor more information about the topic go to https://conventionalcommits.org/\n\noptional arguments:\n -h, --help show this help message and exit\n --debug use debug mode\n -n NAME, --name NAME use the given commitizen (default: cz_conventional_commits)\n -nr NO_RAISE, --no-raise NO_RAISE\n comma separated error codes that won\'t rise error, e.g: cz -nr 1,2,3 bump. See codes at https://commitizen-\n tools.github.io/commitizen/exit_codes/\n\ncommands:\n {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}\n init init commitizen configuration\n commit (c) create new commit\n ls show available commitizens\n example show commit example\n info show information about the cz\n schema show commit schema\n bump bump semantic version based on the git log\n changelog (ch) generate changelog (note that it will overwrite existing file)\n check validates that a commit message matches the commitizen schema\n version get the version of the installed commitizen or the current project (default: installed commitizen)\n```\n\n## Setting up bash completion\n\nWhen using bash as your shell (limited support for zsh, fish, and tcsh is available), Commitizen can use [argcomplete](https://kislyuk.github.io/argcomplete/) for auto-completion. For this argcomplete needs to be enabled.\n\nargcomplete is installed when you install Commitizen since it\'s a dependency.\n\nIf Commitizen is installed globally, global activation can be executed:\n\n```bash\nsudo activate-global-python-argcomplete\n```\n\nFor permanent (but not global) Commitizen activation, use:\n\n```bash\nregister-python-argcomplete cz >> ~/.bashrc\n```\n\nFor one-time activation of argcomplete for Commitizen only, use:\n\n```bash\neval "$(register-python-argcomplete cz)"\n```\n\nFor further information on activation, please visit the [argcomplete website](https://kislyuk.github.io/argcomplete/).\n\n## Sponsors\n\nThese are our cool sponsors!\n\n<!-- sponsors --><!-- sponsors -->\n\n[conventional_commits]: https://www.conventionalcommits.org\n[semver]: https://semver.org/\n[keepchangelog]: https://keepachangelog.com/\n[gitscm]: https://git-scm.com/downloads\n',
|
|
56
56
|
'author': 'Santiago Fraire',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "3.10.0"
|
|
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-3.10.0 → commitizen-3.11.0}/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
|