Skip to content

Restore old branch #1513

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

Closed
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
e4b048d
refactor: improve readability and fix typos
bearomorphism May 15, 2025
3b4dbbc
refactor(version_scheme): cleanup
bearomorphism May 17, 2025
77b3d4b
refactor(commit): simplify call
bearomorphism May 17, 2025
7a1fb3e
test(commit): when nothing is added to commit
bearomorphism May 17, 2025
b7e6a94
refactor(git): code cleanup and better test coverage
bearomorphism May 15, 2025
262733a
test(git): add test for from_rev_and_commit
bearomorphism May 17, 2025
bb63228
docs(git): from_rev_and_commit docstring
bearomorphism May 17, 2025
8477b89
refactor(EOLType): add eol enum back and reorganize methods
bearomorphism May 18, 2025
5810108
refactor(git): refactor get_tag_names
bearomorphism May 18, 2025
3b163a8
refactor(changelog): minor cleanup
bearomorphism May 19, 2025
5cc58d9
refactor(BaseConfig): use setter
bearomorphism May 20, 2025
06970e6
build(poetry): upgrade mypy version to ^1.15.0
bearomorphism May 20, 2025
d7efb1b
refactor(bump): add type for out, replace function with re escape
bearomorphism May 17, 2025
1b9a177
refactor(bump): clean up
bearomorphism May 16, 2025
2286271
test(bump): improve test coverage
bearomorphism May 16, 2025
360057b
fix(defaults): add non-capitalized default constants back and depreca…
bearomorphism May 22, 2025
1ed9d2d
refactor: misc cleanup
bearomorphism May 17, 2025
37a990b
refactor(git): extract _create_commit_cmd_string
bearomorphism May 19, 2025
5b94792
test(test_git): mock os
bearomorphism May 23, 2025
1d7563e
refactor(cli): early return and improve test coverage
bearomorphism May 23, 2025
978358a
build(termcolor): remove termcolor <3 restriction
bearomorphism May 23, 2025
2ccb269
build: specify importlib-metadata version to fix unit tests
bearomorphism May 25, 2025
baee83e
refactor(changelog): better typing, yield
bearomorphism May 24, 2025
75c90d6
build(deps-dev): bump mypy to 1.16.0
bearomorphism May 23, 2025
3bd7439
refactor(mypy): remove `unused-ignore`
gbaian10 May 31, 2025
d830b2f
refactor(cli.py): add type hints
gbaian10 May 31, 2025
0553197
refactor: add comment clarifying `no_raise` parsing to `list[int]`
gbaian10 May 31, 2025
d7594ae
refactor: remove `TypeError` handling since `Python >=3.9` is required
gbaian10 May 31, 2025
f92f380
fix(deprecated): mark deprecate in v5
bearomorphism Jun 1, 2025
868aa71
build(deps-dev): bump ruff
gbaian10 May 31, 2025
ffccec7
style(ruff): resolve F401
gbaian10 May 31, 2025
ff97584
build(ruff): add RUF022 & RUF100 rules
gbaian10 May 31, 2025
0b2b790
style(ruff): run `ruff check --fix`
gbaian10 May 31, 2025
d799f6b
refactor(BaseCommitizen): remove unused process_commit
bearomorphism May 30, 2025
1269f1c
style(tags): improve types
bearomorphism May 29, 2025
a9aeaf2
perf(tags): use set
bearomorphism May 29, 2025
dd7d41f
refactor: fix mypy output and better type
bearomorphism May 29, 2025
c75d3d0
refactor(conventional_commits): remove unnecessary checks
bearomorphism May 29, 2025
12c0dec
refactor: make methods protected, better type
bearomorphism May 30, 2025
d62821c
style: type untyped methods
bearomorphism May 30, 2025
7d40b04
style: remove Union
bearomorphism May 30, 2025
8287e17
style: better type
bearomorphism May 30, 2025
9b153b4
style: add `-> None` to __init__
bearomorphism May 30, 2025
ee4646d
build(ruff,mypy): more strict rules
bearomorphism May 30, 2025
21fae53
fix(BaseConfig): mypy error
bearomorphism May 31, 2025
afcd5c3
build(mypy): remove disallow_untyped_defs because it's already done b…
bearomorphism May 31, 2025
7ac3ea3
refactor(bump): TypedDict for bump argument
bearomorphism May 30, 2025
b7983ca
refactor(changelog): type untyped arguments
bearomorphism May 31, 2025
b2a7a51
refactor(check): remove unused argument
bearomorphism May 31, 2025
db3c1a0
style(bump): rename class for consistency
bearomorphism May 31, 2025
4aed07c
refactor(check): type CheckArgs arguments
bearomorphism May 31, 2025
5616076
refactor(commit): type commit args
bearomorphism May 31, 2025
735ad12
refactor(commands): remove unused args, type version command args
bearomorphism May 31, 2025
e2702fc
style(cli): shorten arg type
bearomorphism May 31, 2025
e631941
docs(bump): comment on a stupid looking pattern
bearomorphism May 31, 2025
92bbab0
fix(Check): make parameters backward compatiable
bearomorphism May 31, 2025
047779b
style(changelog): rename parameter for consistency
bearomorphism May 31, 2025
945d0c3
refactor(bump): improve readability and still bypass mypy check
bearomorphism May 31, 2025
2fa0452
refactor: remove unnecessary bool() and remove Any type from TypedDic…
bearomorphism May 31, 2025
022e552
style(changelog): add TODO to fixable type ignores
bearomorphism Jun 4, 2025
ba0c043
style(cli): more specific type ignore
bearomorphism Jun 4, 2025
8a3a09b
style(cli): rename kwarg to values
bearomorphism Jun 4, 2025
ff1a5ae
refactor(bump): use any to replace 'or' chain
bearomorphism Jun 6, 2025
e0cc9c4
perf(bump): avoid unnecessary list construction and rename variable t…
bearomorphism Jun 5, 2025
05ec0ba
ci: regenerate poetry lock
bearomorphism Jun 8, 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
test(commit): when nothing is added to commit
  • Loading branch information
bearomorphism authored and Lee-W committed Jun 8, 2025
commit 7a1fb3e51a09eb9ea1b0e9cfc747fbbb2af7d879
31 changes: 31 additions & 0 deletions tests/commands/test_commit_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,3 +523,34 @@ def test_commit_command_shows_description_when_use_help_option(

out, _ = capsys.readouterr()
file_regression.check(out, extension=".txt")


@pytest.mark.usefixtures("staging_is_clean")
@pytest.mark.parametrize(
"out", ["no changes added to commit", "nothing added to commit"]
)
def test_commit_when_nothing_added_to_commit(config, mocker: MockFixture, out):
prompt_mock = mocker.patch("questionary.prompt")
prompt_mock.return_value = {
"prefix": "feat",
"subject": "user created",
"scope": "",
"is_breaking_change": False,
"body": "",
"footer": "",
}

commit_mock = mocker.patch("commitizen.git.commit")
commit_mock.return_value = cmd.Command(
out=out,
err="",
stdout=out.encode(),
stderr=b"",
return_code=0,
)
error_mock = mocker.patch("commitizen.out.error")

commands.Commit(config, {})()

commit_mock.assert_called_once()
error_mock.assert_called_once_with(out)