Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add config option for line length warning #1574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Narwhal-fish wants to merge 50 commits into commitizen-tools:master
base: master
Choose a base branch
Loading
from Narwhal-fish:feat/Add-config-option-for-line-length-warning
Open
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
312ca49
refactor(ParseArgs): simplify __call__ function body
bearomorphism Jun 12, 2025
56ef1e0
refactor(ExpectedExit): make the constructor more compact
bearomorphism Jun 12, 2025
8cf7acd
refactor(ScmProvider): replace sorted with max
bearomorphism Jun 12, 2025
fb04e28
refactor(git): remove redundant if branch
bearomorphism Jun 12, 2025
1a1fdc6
fix(Bump): rewrite --get-next NotAllowed error message for consistency
bearomorphism Jun 13, 2025
93f0f27
fix(Changelog): fix _export_template variable type
bearomorphism Jun 13, 2025
7a531db
refactor(TagRules): extract tag_formats property and simplify list co...
bearomorphism Jun 13, 2025
9163ae2
refactor(Init): use ternary operator
bearomorphism Jun 10, 2025
6a90185
refactor(bump): use a loop to shorten a series of similar NotAllowed ...
bearomorphism Jun 9, 2025
c169e09
fix: raise NoVersionSpecifiedError if version is None, and adjust cal...
bearomorphism Jun 13, 2025
0fa668d
docs(taplo): add toml formatter
bearomorphism May 25, 2025
d9f5b49
docs(pre-commit): add taplo to pre-commit hook
bearomorphism May 25, 2025
aa9ab24
refactor(Changelog): remove unnecessary intermediate variables for be...
bearomorphism Jun 13, 2025
3d635d2
refactor(changelog): shorten condition expression and early return
bearomorphism Jun 12, 2025
68c4360
refactor(Init): extract _get_config_data for readability
bearomorphism Jun 11, 2025
05c1722
refactor(process_commit_message): better type and early return
bearomorphism Jun 12, 2025
4a1c516
build: remove not needed importlib-metadata dependency for python >= ...
bearomorphism Jun 10, 2025
84706e1
docs(defaults): deprecate type Questions
bearomorphism Jun 10, 2025
936352b
docs(customization.md): fix grammar mistake, add title to code blocks
bearomorphism Jun 10, 2025
7dccbf6
docs(bump.md): add titles to code blocks and fix minor grammar issues
bearomorphism Jun 11, 2025
189cf0b
ci(github-actions): set organization to true for JamesIves/github-spo...
Lee-W Jun 13, 2025
1d92a05
ci(deps): bump dawidd6/action-homebrew-bump-formula from 4 to 5
dependabot[bot] Jun 16, 2025
fe48353
docs(config.md): Document glob pattern support in `version_files`
edgarrmondragon Jul 12, 2025
eca443d
docs(third-party-commitizen.md): Add cz-path info
Tatsh Jul 14, 2025
83d9308
ci(github-actions): fix sponsorship page generation
Lee-W Jul 15, 2025
40d3062
docs(README): install into dev dependency when using uv
timsu92 Aug 6, 2025
89600f0
docs(README): ensure line break
timsu92 Aug 6, 2025
a69d441
refactor(init): remote extra words
timsu92 Aug 6, 2025
6828582
feat: implement message length limit for commit messages
Narwhal-fish Aug 11, 2025
c300b70
docs(config): add message length limit configuration option
Narwhal-fish Aug 12, 2025
b8918a1
refactor(Init): fix unbounded variable in _ask_tag_format
bearomorphism Jun 10, 2025
30baeab
test(Init): improve coverage for _ask_tag_format
bearomorphism Jun 10, 2025
e70c0a6
fix(ExitCode): add from_str in ExitCode and replace parse_no_raise wi...
bearomorphism Jun 12, 2025
c162290
refactor: use None instead of 0 for message_length_limit and update r...
Narwhal-fish Aug 13, 2025
999f298
Merge branch 'v4-9-0-test' into feat/Add-config-option-for-line-lengt...
Narwhal-fish Aug 13, 2025
d417cf7
fix(Init): fix a typo in _ask_version_provider options and remove unn...
bearomorphism Jun 10, 2025
0c4085e
Merge branch 'v4-9-0-test' into feat/Add-config-option-for-line-lengt...
Narwhal-fish Aug 13, 2025
af6aa62
style: fix line length formatting in check.py
actions-user Aug 13, 2025
1118f65
fix(init): make welcome message easier to read
bearomorphism Jun 9, 2025
e28e3ce
refactor(Init): remove unnecessary methods from ProjectInfo and refac...
bearomorphism Jun 10, 2025
a498804
test(Init): cover _ask_tag test
bearomorphism Jun 10, 2025
d9058b6
fix(init): use pre-push as pre-commit stage
timsu92 Aug 6, 2025
445f013
test(init): check "pre-" is showing in outputs
timsu92 Aug 6, 2025
0b374af
refactor(Init): remove the variable values_to_add and the update_conf...
bearomorphism Jun 11, 2025
f8be15a
test(Init): improve test coverage on config initialization
bearomorphism Jun 11, 2025
f30ae2e
refactor(changelog): shorten generate_tree_from_commits
bearomorphism Jun 12, 2025
7cd62fb
feat(check): add check against default branch
bearomorphism Jun 3, 2025
3b00235
test(changelog): ensure error on missing changelog template filename
ongdisheng Jul 6, 2025
69db5b4
fix(dependencies): update tomlkit version to >=0.8.0,<1.0.0
Narwhal-fish Aug 19, 2025
db902f9
Merge branch 'v4-9-0-test' into feat/Add-config-option-for-line-lengt...
Narwhal-fish Aug 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(Changelog): remove unnecessary intermediate variables for be...
...tter readability
  • Loading branch information
bearomorphism authored and Lee-W committed Jun 17, 2025
commit aa9ab248bcc70f6b90cdab8fee983677bf96e44e
36 changes: 17 additions & 19 deletions commitizen/commands/changelog.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from commitizen import changelog, defaults, factory, git, out
from commitizen.changelog_formats import get_changelog_format
from commitizen.config import BaseConfig
from commitizen.cz.base import ChangelogReleaseHook, MessageBuilderHook
from commitizen.cz.utils import strip_local_version
from commitizen.exceptions import (
DryRunExit,
Expand Down Expand Up @@ -188,15 +187,6 @@ def __call__(self) -> None:
commit_parser = self.cz.commit_parser
changelog_pattern = self.cz.changelog_pattern
start_rev = self.start_rev
unreleased_version = self.unreleased_version
changelog_meta = changelog.Metadata()
change_type_map: dict[str, str] | None = self.change_type_map
changelog_message_builder_hook: MessageBuilderHook | None = (
self.cz.changelog_message_builder_hook
)
changelog_release_hook: ChangelogReleaseHook | None = (
self.cz.changelog_release_hook
)

if self.export_template_to:
return self._export_template(self.export_template_to)
Expand All @@ -213,45 +203,53 @@ def __call__(self) -> None:
assert self.file_name

tags = self.tag_rules.get_version_tags(git.get_tags(), warn=True)
end_rev = ""
changelog_meta = changelog.Metadata()
if self.incremental:
changelog_meta = self.changelog_format.get_metadata(self.file_name)
if changelog_meta.latest_version:
start_rev = self._find_incremental_rev(
strip_local_version(changelog_meta.latest_version_tag or ""), tags
)

end_rev = ""
if self.rev_range:
start_rev, end_rev = changelog.get_oldest_and_newest_rev(
tags,
self.rev_range,
self.tag_rules,
)

commits = git.get_commits(start=start_rev, end=end_rev, args="--topo-order")
if not commits and (
self.current_version is None or not self.current_version.is_prerelease
):
raise NoCommitsFoundError("No commits found")

tree = changelog.generate_tree_from_commits(
commits,
tags,
commit_parser,
changelog_pattern,
unreleased_version,
change_type_map=change_type_map,
changelog_message_builder_hook=changelog_message_builder_hook,
changelog_release_hook=changelog_release_hook,
self.unreleased_version,
change_type_map=self.change_type_map,
changelog_message_builder_hook=self.cz.changelog_message_builder_hook,
changelog_release_hook=self.cz.changelog_release_hook,
rules=self.tag_rules,
)
if self.change_type_order:
tree = changelog.generate_ordered_changelog_tree(
tree, self.change_type_order
)

extras = self.cz.template_extras.copy()
extras.update(self.config.settings["extras"])
extras.update(self.extras)
changelog_out = changelog.render_changelog(
tree, loader=self.cz.template_loader, template=self.template, **extras
tree,
self.cz.template_loader,
self.template,
**{
**self.cz.template_extras,
**self.config.settings["extras"],
**self.extras,
},
).lstrip("\n")

# Dry_run is executed here to avoid checking and reading the files
Expand Down

AltStyle によって変換されたページ (->オリジナル) /