commitizen 3.24.0__tar.gz → 3.26.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.
Files changed (67) hide show
  1. {commitizen-3.24.0 → commitizen-3.26.0}/PKG-INFO +2 -2
  2. commitizen-3.26.0/commitizen/__version__.py +1 -0
  3. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cli.py +6 -0
  4. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/commit.py +11 -1
  5. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/conventional_commits/conventional_commits.py +1 -1
  6. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/jira/jira.py +1 -1
  7. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/exceptions.py +6 -0
  8. {commitizen-3.24.0 → commitizen-3.26.0}/docs/README.md +1 -1
  9. {commitizen-3.24.0 → commitizen-3.26.0}/pyproject.toml +3 -3
  10. commitizen-3.24.0/commitizen/__version__.py +0 -1
  11. {commitizen-3.24.0 → commitizen-3.26.0}/LICENSE +0 -0
  12. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/__init__.py +0 -0
  13. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/__main__.py +0 -0
  14. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/bump.py +0 -0
  15. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/changelog.py +0 -0
  16. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/changelog_formats/__init__.py +0 -0
  17. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/changelog_formats/asciidoc.py +0 -0
  18. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/changelog_formats/base.py +0 -0
  19. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/changelog_formats/markdown.py +0 -0
  20. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/changelog_formats/restructuredtext.py +0 -0
  21. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/changelog_formats/textile.py +0 -0
  22. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cmd.py +0 -0
  23. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/__init__.py +0 -0
  24. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/bump.py +0 -0
  25. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/changelog.py +0 -0
  26. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/check.py +0 -0
  27. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/example.py +0 -0
  28. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/info.py +0 -0
  29. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/init.py +0 -0
  30. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/list_cz.py +0 -0
  31. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/schema.py +0 -0
  32. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/commands/version.py +0 -0
  33. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/config/__init__.py +0 -0
  34. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/config/base_config.py +0 -0
  35. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/config/json_config.py +0 -0
  36. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/config/toml_config.py +0 -0
  37. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/config/yaml_config.py +0 -0
  38. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/__init__.py +0 -0
  39. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/base.py +0 -0
  40. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/conventional_commits/__init__.py +0 -0
  41. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/conventional_commits/conventional_commits_info.txt +0 -0
  42. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/customize/__init__.py +0 -0
  43. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/customize/customize.py +0 -0
  44. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/customize/customize_info.txt +0 -0
  45. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/exceptions.py +0 -0
  46. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/jira/__init__.py +0 -0
  47. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/jira/jira_info.txt +0 -0
  48. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/cz/utils.py +0 -0
  49. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/defaults.py +0 -0
  50. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/factory.py +0 -0
  51. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/git.py +0 -0
  52. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/hooks.py +0 -0
  53. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/out.py +0 -0
  54. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/__init__.py +0 -0
  55. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/base_provider.py +0 -0
  56. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/cargo_provider.py +0 -0
  57. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/commitizen_provider.py +0 -0
  58. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/composer_provider.py +0 -0
  59. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/npm_provider.py +0 -0
  60. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/pep621_provider.py +0 -0
  61. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/poetry_provider.py +0 -0
  62. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/providers/scm_provider.py +0 -0
  63. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/templates/CHANGELOG.adoc.j2 +0 -0
  64. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/templates/CHANGELOG.md.j2 +0 -0
  65. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/templates/CHANGELOG.rst.j2 +0 -0
  66. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/templates/CHANGELOG.textile.j2 +0 -0
  67. {commitizen-3.24.0 → commitizen-3.26.0}/commitizen/version_schemes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: commitizen
3
- Version: 3.24.0
3
+ Version: 3.26.0
4
4
  Summary: Python commitizen client tool
5
5
  Home-page: https://github.com/commitizen-tools/commitizen
6
6
  License: MIT
@@ -70,7 +70,7 @@ descriptive commits.
70
70
  ### Features
71
71
 
72
72
  - Command-line utility to create commits with your rules. Defaults: [Conventional commits][conventional_commits]
73
- - Bump version automatically using [semantic versioning][semver] based on the commits. [Read More](./bump.md)
73
+ - Bump version automatically using [semantic versioning][semver] based on the commits. [Read More](./commands/bump.md)
74
74
  - Generate a changelog using [Keep a changelog][keepchangelog]
75
75
  - Update your project's version files automatically
76
76
  - Display information about your commit rules (commands: schema, example, info)
@@ -0,0 +1 @@
1
+ __version__ = "3.26.0"
@@ -154,6 +154,12 @@ data = {
154
154
  "action": "store_true",
155
155
  "help": "Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.",
156
156
  },
157
+ {
158
+ "name": ["-l", "--message-length-limit"],
159
+ "type": int,
160
+ "default": 0,
161
+ "help": "length limit of the commit message; 0 for no limit",
162
+ },
157
163
  ],
158
164
  },
159
165
  {
@@ -12,6 +12,7 @@ from commitizen.cz.exceptions import CzException
12
12
  from commitizen.cz.utils import get_backup_file_path
13
13
  from commitizen.exceptions import (
14
14
  CommitError,
15
+ CommitMessageLengthExceededError,
15
16
  CustomError,
16
17
  DryRunExit,
17
18
  NoAnswersError,
@@ -61,7 +62,16 @@ class Commit:
61
62
 
62
63
  if not answers:
63
64
  raise NoAnswersError()
64
- return cz.message(answers)
65
+
66
+ message = cz.message(answers)
67
+ message_len = len(message.partition("\n")[0].strip())
68
+ message_length_limit: int = self.arguments.get("message_length_limit", 0)
69
+ if 0 < message_length_limit < message_len:
70
+ raise CommitMessageLengthExceededError(
71
+ f"Length of commit message exceeds limit ({message_len}/{message_length_limit})"
72
+ )
73
+
74
+ return message
65
75
 
66
76
  def __call__(self):
67
77
  dry_run: bool = self.arguments.get("dry_run")
@@ -102,7 +102,7 @@ class ConventionalCommitsCz(BaseCommitizen):
102
102
  {
103
103
  "value": "ci",
104
104
  "name": (
105
- "ci: Changes to our CI configuration files and "
105
+ "ci: Changes to CI configuration files and "
106
106
  "scripts (example scopes: GitLabCI)"
107
107
  ),
108
108
  "key": "c",
@@ -44,7 +44,7 @@ class JiraSmartCz(BaseCommitizen):
44
44
  ]
45
45
  return questions
46
46
 
47
- def message(self, answers) -> str:
47
+ def message(self, answers: dict) -> str:
48
48
  return " ".join(
49
49
  filter(
50
50
  bool,
@@ -36,6 +36,7 @@ class ExitCode(enum.IntEnum):
36
36
  CHANGELOG_FORMAT_UNKNOWN = 29
37
37
  CONFIG_FILE_NOT_FOUND = 30
38
38
  CONFIG_FILE_IS_EMPTY = 31
39
+ COMMIT_MESSAGE_LENGTH_LIMIT_EXCEEDED = 32
39
40
 
40
41
 
41
42
  class CommitizenException(Exception):
@@ -201,3 +202,8 @@ class ConfigFileNotFound(CommitizenException):
201
202
  class ConfigFileIsEmpty(CommitizenException):
202
203
  exit_code = ExitCode.CONFIG_FILE_IS_EMPTY
203
204
  message = "Config file is empty, please check your file path again."
205
+
206
+
207
+ class CommitMessageLengthExceededError(CommitizenException):
208
+ exit_code = ExitCode.COMMIT_MESSAGE_LENGTH_LIMIT_EXCEEDED
209
+ message = "Length of commit message exceeds the given limit."
@@ -32,7 +32,7 @@ descriptive commits.
32
32
  ### Features
33
33
 
34
34
  - Command-line utility to create commits with your rules. Defaults: [Conventional commits][conventional_commits]
35
- - Bump version automatically using [semantic versioning][semver] based on the commits. [Read More](./bump.md)
35
+ - Bump version automatically using [semantic versioning][semver] based on the commits. [Read More](./commands/bump.md)
36
36
  - Generate a changelog using [Keep a changelog][keepchangelog]
37
37
  - Update your project's version files automatically
38
38
  - Display information about your commit rules (commands: schema, example, info)
@@ -1,5 +1,5 @@
1
1
  [tool.commitizen]
2
- version = "3.24.0"
2
+ version = "3.26.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.24.0"
12
+ version = "3.26.0"
13
13
  description = "Python commitizen client tool"
14
14
  authors = ["Santiago Fraire <santiwilly@gmail.com>"]
15
15
  license = "MIT"
@@ -62,7 +62,7 @@ pytest-xdist = "^3.1.0"
62
62
  # code formatter
63
63
  black = ">=23.11,<25.0"
64
64
  # linter
65
- ruff = ">=0.1.6,<0.4.0"
65
+ ruff = ">=0.1.6,<0.5.0"
66
66
  pre-commit = ">=2.18,<4.0"
67
67
  mypy = "^1.4"
68
68
  types-PyYAML = ">=5.4.3,<7.0.0"
@@ -1 +0,0 @@
1
- __version__ = "3.24.0"
File without changes