Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
commitizen/commitizen/defaults.py at script-parallel-filter · commitizen-tools/commitizen · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
commitizen-tools
/
commitizen
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
350
Star
3.5k
Code
Issues
116
Pull requests
47
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Files
Expand file tree
script-parallel-filter
Breadcrumbs
commitizen
/
commitizen
/
defaults.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
207 lines (186 loc) · 6.06 KB
script-parallel-filter
Breadcrumbs
commitizen
/
commitizen
/
defaults.py
Copy path
Top
File metadata and controls
Code
Blame
207 lines (186 loc) · 6.06 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
from
__future__
import
annotations
import
warnings
from
collections
import
OrderedDict
from
collections
.
abc
import
Iterable
,
MutableMapping
,
Sequence
from
typing
import
TYPE_CHECKING
,
Any
,
TypedDict
if
TYPE_CHECKING
:
import
pathlib
from
commitizen
.
question
import
CzQuestion
class
CzSettings
(
TypedDict
,
total
=
False
):
bump_pattern
:
str
bump_map
:
OrderedDict
[
str
,
str
]
bump_map_major_version_zero
:
OrderedDict
[
str
,
str
]
change_type_order
:
list
[
str
]
questions
:
Iterable
[
CzQuestion
]
example
:
str
|
None
schema_pattern
:
str
|
None
schema
:
str
|
None
info_path
:
str
|
pathlib
.
Path
info
:
str
message_template
:
str
commit_parser
:
str
|
None
changelog_pattern
:
str
|
None
change_type_map
:
dict
[
str
,
str
]
|
None
class
Settings
(
TypedDict
,
total
=
False
):
allow_abort
:
bool
allowed_prefixes
:
list
[
str
]
always_signoff
:
bool
annotated_tag
:
bool
bump_message
:
str
|
None
change_type_map
:
dict
[
str
,
str
]
changelog_file
:
str
changelog_format
:
str
|
None
changelog_incremental
:
bool
changelog_merge_prerelease
:
bool
changelog_start_rev
:
str
|
None
customize
:
CzSettings
encoding
:
str
extras
:
dict
[
str
,
Any
]
gpg_sign
:
bool
ignored_tag_formats
:
Sequence
[
str
]
legacy_tag_formats
:
Sequence
[
str
]
major_version_zero
:
bool
message_length_limit
:
int
name
:
str
post_bump_hooks
:
list
[
str
]
|
None
pre_bump_hooks
:
list
[
str
]
|
None
prerelease_offset
:
int
retry_after_failure
:
bool
style
:
list
[
tuple
[
str
,
str
]]
tag_format
:
str
template
:
str
|
None
update_changelog_on_bump
:
bool
use_shortcuts
:
bool
version_files
:
list
[
str
]
version_provider
:
str
|
None
version_scheme
:
str
|
None
version_type
:
str
|
None
version
:
str
|
None
breaking_change_exclamation_in_title
:
bool
CONFIG_FILES
:
tuple
[
str
, ...]
=
(
".cz.toml"
,
"cz.toml"
,
".cz.json"
,
"cz.json"
,
".cz.yaml"
,
"cz.yaml"
,
"pyproject.toml"
,
)
ENCODING
=
"utf-8"
DEFAULT_SETTINGS
:
Settings
=
{
"name"
:
"cz_conventional_commits"
,
"version"
:
None
,
"version_files"
: [],
"version_provider"
:
"commitizen"
,
"version_scheme"
:
None
,
"tag_format"
:
"$version"
,
# example v$version
"legacy_tag_formats"
: [],
"ignored_tag_formats"
: [],
"bump_message"
:
None
,
# bumped v$current_version to $new_version
"retry_after_failure"
:
False
,
"allow_abort"
:
False
,
"allowed_prefixes"
: [
"Merge"
,
"Revert"
,
"Pull request"
,
"fixup!"
,
"squash!"
,
"amend!"
,
],
"changelog_file"
:
"CHANGELOG.md"
,
"changelog_format"
:
None
,
# default guessed from changelog_file
"changelog_incremental"
:
False
,
"changelog_start_rev"
:
None
,
"changelog_merge_prerelease"
:
False
,
"update_changelog_on_bump"
:
False
,
"use_shortcuts"
:
False
,
"major_version_zero"
:
False
,
"pre_bump_hooks"
: [],
"post_bump_hooks"
: [],
"prerelease_offset"
:
0
,
"encoding"
:
ENCODING
,
"always_signoff"
:
False
,
"template"
:
None
,
# default provided by plugin
"extras"
: {},
"breaking_change_exclamation_in_title"
:
False
,
"message_length_limit"
:
0
,
# 0 for no limit
}
MAJOR
=
"MAJOR"
MINOR
=
"MINOR"
PATCH
=
"PATCH"
CHANGELOG_FORMAT
=
"markdown"
BUMP_PATTERN
=
r"^((BREAKING[\-\ ]CHANGE|\w+)(\(.+\))?!?):"
BUMP_MAP
=
OrderedDict
(
(
(
r"^.+!$"
,
MAJOR
),
(
r"^BREAKING[\-\ ]CHANGE"
,
MAJOR
),
(
r"^feat"
,
MINOR
),
(
r"^fix"
,
PATCH
),
(
r"^refactor"
,
PATCH
),
(
r"^perf"
,
PATCH
),
)
)
BUMP_MAP_MAJOR_VERSION_ZERO
=
OrderedDict
(
(
(
r"^.+!$"
,
MINOR
),
(
r"^BREAKING[\-\ ]CHANGE"
,
MINOR
),
(
r"^feat"
,
MINOR
),
(
r"^fix"
,
PATCH
),
(
r"^refactor"
,
PATCH
),
(
r"^perf"
,
PATCH
),
)
)
CHANGE_TYPE_ORDER
=
[
"BREAKING CHANGE"
,
"Feat"
,
"Fix"
,
"Refactor"
,
"Perf"
]
BUMP_MESSAGE
=
"bump: version $current_version → $new_version"
def
get_tag_regexes
(
version_regex
:
str
,
)
->
dict
[
str
,
str
]:
regexes
=
{
"version"
:
version_regex
,
"major"
:
r"(?P<major>\d+)"
,
"minor"
:
r"(?P<minor>\d+)"
,
"patch"
:
r"(?P<patch>\d+)"
,
# Allow ``\w+`` (PEP-440 ``rc0``) as well as ``\w+\.\w+(\.\w+)*``
# (SemVer2 ``rc.0``, ``alpha.beta.1``). The original ``\w+\d+`` only
# matched the PEP-440 form and produced "Invalid version tag" warnings
# for SemVer2-style tags created by commitizen itself (#1614).
"prerelease"
:
r"(?P<prerelease>\w+(?:\.\w+)*)?"
,
# Match either ``.dev1`` (PEP-440 with leading dot) or ``dev1``
# (SemVer / SemVer2 / users substituting ``${devrelease}`` directly
# in a ``tag_format`` -- see #1615). A bare ``\d+`` after the prefix
# would let the regex match arbitrary numeric suffixes, so the
# ``dev`` literal is required.
"devrelease"
:
r"(?P<devrelease>\.?dev\d+)?"
,
}
return
{
**
{
f"$
{
k
}
"
:
v
for
k
,
v
in
regexes
.
items
()},
**
{
f"${{
{
k
}
}}"
:
v
for
k
,
v
in
regexes
.
items
()},
}
# Type
Questions
=
Iterable
[
MutableMapping
[
str
,
Any
]]
# TODO: remove this in v5
def
__getattr__
(
name
:
str
)
->
Any
:
# PEP-562: deprecate module-level variable
# {"deprecated key": (value, "new key")}
deprecated_vars
=
{
"bump_pattern"
: (
BUMP_PATTERN
,
"BUMP_PATTERN"
),
"bump_map"
: (
BUMP_MAP
,
"BUMP_MAP"
),
"bump_map_major_version_zero"
: (
BUMP_MAP_MAJOR_VERSION_ZERO
,
"BUMP_MAP_MAJOR_VERSION_ZERO"
,
),
"bump_message"
: (
BUMP_MESSAGE
,
"BUMP_MESSAGE"
),
"change_type_order"
: (
CHANGE_TYPE_ORDER
,
"CHANGE_TYPE_ORDER"
),
"encoding"
: (
ENCODING
,
"ENCODING"
),
"name"
: (
DEFAULT_SETTINGS
[
"name"
],
"DEFAULT_SETTINGS['name']"
),
"Questions"
: (
Questions
,
"Iterable[CzQuestion]"
),
}
if
name
in
deprecated_vars
:
value
,
replacement
=
deprecated_vars
[
name
]
warnings
.
warn
(
f"
{
name
}
is deprecated and will be removed in v5. "
f"Use
{
replacement
}
instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
return
value
raise
AttributeError
(
f"
{
name
}
is not an attribute of
{
__name__
}
"
)
You can’t perform that action at this time.