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): shorten condition expression and early return
  • Loading branch information
bearomorphism authored and Lee-W committed Jun 17, 2025
commit 3d635d2bc196b5d296883a5c7fe1876c668f423d
19 changes: 10 additions & 9 deletions commitizen/changelog.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def incremental_build(
unreleased_start = metadata.unreleased_start
unreleased_end = metadata.unreleased_end
latest_version_position = metadata.latest_version_position

skip = False
output_lines: list[str] = []
for index, line in enumerate(lines):
Expand All @@ -260,9 +261,7 @@ def incremental_build(
skip = False
if (
latest_version_position is None
or isinstance(latest_version_position, int)
and isinstance(unreleased_end, int)
and latest_version_position > unreleased_end
or latest_version_position > unreleased_end
):
continue

Expand All @@ -271,13 +270,15 @@ def incremental_build(

if index == latest_version_position:
output_lines.extend([new_content, "\n"])

output_lines.append(line)
if not isinstance(latest_version_position, int):
if output_lines and output_lines[-1].strip():
# Ensure at least one blank line between existing and new content.
output_lines.append("\n")
output_lines.append(new_content)

if latest_version_position is not None:
return output_lines

if output_lines and output_lines[-1].strip():
# Ensure at least one blank line between existing and new content.
output_lines.append("\n")
output_lines.append(new_content)
return output_lines


Expand Down

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