diff --git a/docs/contributing.md b/docs/contributing.md index 0e3ae4df0..750fb0bc1 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -64,6 +64,7 @@ If you're a first-time contributor, please check out issues labeled [good first - Run the full test suite: `uv run poe all` - Ensure test coverage doesn't drop (we use [CodeCov](https://app.codecov.io/gh/commitizen-tools/commitizen)) - For documentation changes, run `uv run poe doc` to check for warnings/errors + - If you need to change some file regression snapshots, run: `uv run poe test:regen` 4. **Committing Changes** - Use Commitizen to make commits (we follow [conventional commits](https://www.conventionalcommits.org/)) - Example: `cz commit` diff --git a/pyproject.toml b/pyproject.toml index ec456ed48..705686434 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,7 @@ semver = "commitizen.version_schemes:SemVer" semver2 = "commitizen.version_schemes:SemVer2" [dependency-groups] -dev = ["ipython>=8.0", "tox>4", "poethepoet>=0.34.0"] +dev = ["ipython>=8.0", "tox>4", "tox-uv", "poethepoet>=0.34.0"] test = [ "pytest>=7.2", @@ -263,6 +263,12 @@ test.cmd = "pytest -n 3 --dist=loadfile" "test:all".help = "Run the test suite on all supported Python versions" "test:all".cmd = "tox --parallel" +"test:regen".help = "Regenerate the test fixtures" +"test:regen".parallel = [ + { ref = "test -k 'not py_' --regen-all" }, + { ref = "test:all -- -k py_ --regen-all" }, +] + cover.help = "Run the test suite with coverage" cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen --junitxml=junit.xml -o junit_family=legacy" diff --git a/tests/commands/test_common_command.py b/tests/commands/test_common_command.py index 71ade5eda..bb9de90bb 100644 --- a/tests/commands/test_common_command.py +++ b/tests/commands/test_common_command.py @@ -7,10 +7,6 @@ from commitizen.commands import Example, Info, ListCz, Schema -@pytest.mark.skipif( - sys.version_info < (3, 13), - reason="The output message of argparse is different between Python 3.13 and lower than Python 3.13", -) @pytest.mark.parametrize( "command", [ @@ -26,6 +22,7 @@ "version", ], ) +@pytest.mark.usefixtures("python_version") def test_command_shows_description_when_use_help_option( mocker: MockFixture, capsys, @@ -35,7 +32,7 @@ def test_command_shows_description_when_use_help_option( ): """Test that the command shows the description when the help option is used. - Note: If the command description changes, please run `pytest tests/commands/test_common_command.py --regen-all` to regenerate the test files. + Note: If the command description changes, please run `poe test:regen` to regenerate the test files. """ # Force consistent terminal output monkeypatch.setenv("COLUMNS", "80") diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_bump_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_bump_.txt new file mode 100644 index 000000000..ad0a69327 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_bump_.txt @@ -0,0 +1,82 @@ +usage: cz bump [-h] [--dry-run] [--files-only] [--local-version] [--changelog] + [--no-verify] [--yes] [--tag-format TAG_FORMAT] + [--bump-message BUMP_MESSAGE] [--prerelease {alpha,beta,rc}] + [--devrelease DEVRELEASE] [--increment {MAJOR,MINOR,PATCH}] + [--increment-mode {linear,exact}] [--check-consistency] + [--annotated-tag] + [--annotated-tag-message ANNOTATED_TAG_MESSAGE] [--gpg-sign] + [--changelog-to-stdout] [--git-output-to-stderr] [--retry] + [--major-version-zero] [--template TEMPLATE] [--extra EXTRA] + [--file-name FILE_NAME] [--prerelease-offset PRERELEASE_OFFSET] + [--version-scheme {pep440,semver,semver2}] + [--version-type {pep440,semver,semver2}] + [--build-metadata BUILD_METADATA] [--get-next] + [--allow-no-commit] + [MANUAL_VERSION] + +bump semantic version based on the git log + +positional arguments: + MANUAL_VERSION bump to the given version (e.g: 1.5.3) + +options: + -h, --help show this help message and exit + --dry-run show output to stdout, no commit, no modified files + --files-only bump version in the files from the config + --local-version bump only the local version portion + --changelog, -ch generate the changelog for the newest version + --no-verify this option bypasses the pre-commit and commit-msg + hooks + --yes accept automatically questions done + --tag-format TAG_FORMAT + the format used to tag the commit and read it, use it + in existing projects, wrap around simple quotes + --bump-message BUMP_MESSAGE + template used to create the release commit, useful + when working with CI + --prerelease {alpha,beta,rc}, -pr {alpha,beta,rc} + choose type of prerelease + --devrelease DEVRELEASE, -d DEVRELEASE + specify non-negative integer for dev. release + --increment {MAJOR,MINOR,PATCH} + manually specify the desired increment + --increment-mode {linear,exact} + set the method by which the new version is chosen. + 'linear' (default) guesses the next version based on + typical linear version progression, such that bumping + of a pre-release with lower precedence than the + current pre-release phase maintains the current phase + of higher precedence. 'exact' applies the changes that + have been specified (or determined from the commit + log) without interpretation, such that the increment + and pre-release are always honored + --check-consistency, -cc + check consistency among versions defined in commitizen + configuration and version_files + --annotated-tag, -at create annotated tag instead of lightweight one + --annotated-tag-message ANNOTATED_TAG_MESSAGE, -atm ANNOTATED_TAG_MESSAGE + create annotated tag message + --gpg-sign, -s sign tag instead of lightweight one + --changelog-to-stdout + Output changelog to the stdout + --git-output-to-stderr + Redirect git output to stderr + --retry retry commit if it fails the 1st time + --major-version-zero keep major version at zero, even for breaking changes + --template TEMPLATE, -t TEMPLATE + changelog template file name (relative to the current + working directory) + --extra EXTRA, -e EXTRA + a changelog extra variable (in the form 'key=value') + --file-name FILE_NAME + file name of changelog (default: 'CHANGELOG.md') + --prerelease-offset PRERELEASE_OFFSET + start pre-releases with this offset + --version-scheme {pep440,semver,semver2} + choose version scheme + --version-type {pep440,semver,semver2} + Deprecated, use --version-scheme instead + --build-metadata BUILD_METADATA + Add additional build-metadata to the version-number + --get-next Determine the next version and write to stdout + --allow-no-commit bump version without eligible commits diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_changelog_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_changelog_.txt new file mode 100644 index 000000000..f4aa1ca2a --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_changelog_.txt @@ -0,0 +1,42 @@ +usage: cz changelog [-h] [--dry-run] [--file-name FILE_NAME] + [--unreleased-version UNRELEASED_VERSION] [--incremental] + [--start-rev START_REV] [--merge-prerelease] + [--version-scheme {pep440,semver,semver2}] + [--export-template EXPORT_TEMPLATE] [--template TEMPLATE] + [--extra EXTRA] [--tag-format TAG_FORMAT] + [rev_range] + +generate changelog (note that it will overwrite existing file) + +positional arguments: + rev_range generates changelog for the given version (e.g: 1.5.3) + or version range (e.g: 1.5.3..1.7.9) + +options: + -h, --help show this help message and exit + --dry-run show changelog to stdout + --file-name FILE_NAME + file name of changelog (default: 'CHANGELOG.md') + --unreleased-version UNRELEASED_VERSION + set the value for the new version (use the tag value), + instead of using unreleased + --incremental generates changelog from last created version, useful + if the changelog has been manually modified + --start-rev START_REV + start rev of the changelog. If not set, it will + generate changelog from the start + --merge-prerelease collect all changes from prereleases into next non- + prerelease. If not set, it will include prereleases in + the changelog + --version-scheme {pep440,semver,semver2} + choose version scheme + --export-template EXPORT_TEMPLATE + Export the changelog template into this file instead + of rendering it + --template TEMPLATE, -t TEMPLATE + changelog template file name (relative to the current + working directory) + --extra EXTRA, -e EXTRA + a changelog extra variable (in the form 'key=value') + --tag-format TAG_FORMAT + The format of the tag, wrap around simple quotes diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_check_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_check_.txt new file mode 100644 index 000000000..53c4e7ed1 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_check_.txt @@ -0,0 +1,28 @@ +usage: cz check [-h] + [--commit-msg-file COMMIT_MSG_FILE | --rev-range REV_RANGE | -d | -m MESSAGE] + [--allow-abort] [--allowed-prefixes [ALLOWED_PREFIXES ...]] + [-l MESSAGE_LENGTH_LIMIT] + +validates that a commit message matches the commitizen schema + +options: + -h, --help show this help message and exit + --commit-msg-file COMMIT_MSG_FILE + ask for the name of the temporal file that contains + the commit message. Using it in a git hook script: + MSG_FILE=$1 + --rev-range REV_RANGE + a range of git rev to check. e.g, master..HEAD + -d, --use-default-range + check from the default branch to HEAD. e.g, + refs/remotes/origin/master..HEAD + -m MESSAGE, --message MESSAGE + commit message that needs to be checked + --allow-abort allow empty commit messages, which typically abort a + commit + --allowed-prefixes [ALLOWED_PREFIXES ...] + allowed commit message prefixes. If the message starts + by one of these prefixes, the message won't be checked + against the regex + -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT + length limit of the commit message; 0 for no limit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_commit_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_commit_.txt new file mode 100644 index 000000000..c84243342 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_commit_.txt @@ -0,0 +1,22 @@ +usage: cz commit [-h] [--retry] [--no-retry] [--dry-run] + [--write-message-to-file FILE_PATH] [-s] [-a] [-e] + [-l MESSAGE_LENGTH_LIMIT] [--] + +create new commit + +options: + -h, --help show this help message and exit + --retry retry last commit + --no-retry skip retry if retry_after_failure is set to true + --dry-run show output to stdout, no commit, no modified files + --write-message-to-file FILE_PATH + write message to file before committing (can be + combined with --dry-run) + -s, --signoff Deprecated, use 'cz commit -- -s' instead + -a, --all 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. + -e, --edit edit the commit message before committing + -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT + length limit of the commit message; 0 for no limit + -- Positional arguments separator (recommended) diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_example_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_example_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_example_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_example_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_info_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_info_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_info_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_info_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_init_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_init_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_init_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_init_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_ls_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_ls_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_ls_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_ls_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_schema_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_schema_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_schema_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_schema_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_version_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_version_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_version_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_version_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_bump_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_bump_.txt new file mode 100644 index 000000000..ad0a69327 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_bump_.txt @@ -0,0 +1,82 @@ +usage: cz bump [-h] [--dry-run] [--files-only] [--local-version] [--changelog] + [--no-verify] [--yes] [--tag-format TAG_FORMAT] + [--bump-message BUMP_MESSAGE] [--prerelease {alpha,beta,rc}] + [--devrelease DEVRELEASE] [--increment {MAJOR,MINOR,PATCH}] + [--increment-mode {linear,exact}] [--check-consistency] + [--annotated-tag] + [--annotated-tag-message ANNOTATED_TAG_MESSAGE] [--gpg-sign] + [--changelog-to-stdout] [--git-output-to-stderr] [--retry] + [--major-version-zero] [--template TEMPLATE] [--extra EXTRA] + [--file-name FILE_NAME] [--prerelease-offset PRERELEASE_OFFSET] + [--version-scheme {pep440,semver,semver2}] + [--version-type {pep440,semver,semver2}] + [--build-metadata BUILD_METADATA] [--get-next] + [--allow-no-commit] + [MANUAL_VERSION] + +bump semantic version based on the git log + +positional arguments: + MANUAL_VERSION bump to the given version (e.g: 1.5.3) + +options: + -h, --help show this help message and exit + --dry-run show output to stdout, no commit, no modified files + --files-only bump version in the files from the config + --local-version bump only the local version portion + --changelog, -ch generate the changelog for the newest version + --no-verify this option bypasses the pre-commit and commit-msg + hooks + --yes accept automatically questions done + --tag-format TAG_FORMAT + the format used to tag the commit and read it, use it + in existing projects, wrap around simple quotes + --bump-message BUMP_MESSAGE + template used to create the release commit, useful + when working with CI + --prerelease {alpha,beta,rc}, -pr {alpha,beta,rc} + choose type of prerelease + --devrelease DEVRELEASE, -d DEVRELEASE + specify non-negative integer for dev. release + --increment {MAJOR,MINOR,PATCH} + manually specify the desired increment + --increment-mode {linear,exact} + set the method by which the new version is chosen. + 'linear' (default) guesses the next version based on + typical linear version progression, such that bumping + of a pre-release with lower precedence than the + current pre-release phase maintains the current phase + of higher precedence. 'exact' applies the changes that + have been specified (or determined from the commit + log) without interpretation, such that the increment + and pre-release are always honored + --check-consistency, -cc + check consistency among versions defined in commitizen + configuration and version_files + --annotated-tag, -at create annotated tag instead of lightweight one + --annotated-tag-message ANNOTATED_TAG_MESSAGE, -atm ANNOTATED_TAG_MESSAGE + create annotated tag message + --gpg-sign, -s sign tag instead of lightweight one + --changelog-to-stdout + Output changelog to the stdout + --git-output-to-stderr + Redirect git output to stderr + --retry retry commit if it fails the 1st time + --major-version-zero keep major version at zero, even for breaking changes + --template TEMPLATE, -t TEMPLATE + changelog template file name (relative to the current + working directory) + --extra EXTRA, -e EXTRA + a changelog extra variable (in the form 'key=value') + --file-name FILE_NAME + file name of changelog (default: 'CHANGELOG.md') + --prerelease-offset PRERELEASE_OFFSET + start pre-releases with this offset + --version-scheme {pep440,semver,semver2} + choose version scheme + --version-type {pep440,semver,semver2} + Deprecated, use --version-scheme instead + --build-metadata BUILD_METADATA + Add additional build-metadata to the version-number + --get-next Determine the next version and write to stdout + --allow-no-commit bump version without eligible commits diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_changelog_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_changelog_.txt new file mode 100644 index 000000000..f4aa1ca2a --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_changelog_.txt @@ -0,0 +1,42 @@ +usage: cz changelog [-h] [--dry-run] [--file-name FILE_NAME] + [--unreleased-version UNRELEASED_VERSION] [--incremental] + [--start-rev START_REV] [--merge-prerelease] + [--version-scheme {pep440,semver,semver2}] + [--export-template EXPORT_TEMPLATE] [--template TEMPLATE] + [--extra EXTRA] [--tag-format TAG_FORMAT] + [rev_range] + +generate changelog (note that it will overwrite existing file) + +positional arguments: + rev_range generates changelog for the given version (e.g: 1.5.3) + or version range (e.g: 1.5.3..1.7.9) + +options: + -h, --help show this help message and exit + --dry-run show changelog to stdout + --file-name FILE_NAME + file name of changelog (default: 'CHANGELOG.md') + --unreleased-version UNRELEASED_VERSION + set the value for the new version (use the tag value), + instead of using unreleased + --incremental generates changelog from last created version, useful + if the changelog has been manually modified + --start-rev START_REV + start rev of the changelog. If not set, it will + generate changelog from the start + --merge-prerelease collect all changes from prereleases into next non- + prerelease. If not set, it will include prereleases in + the changelog + --version-scheme {pep440,semver,semver2} + choose version scheme + --export-template EXPORT_TEMPLATE + Export the changelog template into this file instead + of rendering it + --template TEMPLATE, -t TEMPLATE + changelog template file name (relative to the current + working directory) + --extra EXTRA, -e EXTRA + a changelog extra variable (in the form 'key=value') + --tag-format TAG_FORMAT + The format of the tag, wrap around simple quotes diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_check_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_check_.txt new file mode 100644 index 000000000..53c4e7ed1 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_check_.txt @@ -0,0 +1,28 @@ +usage: cz check [-h] + [--commit-msg-file COMMIT_MSG_FILE | --rev-range REV_RANGE | -d | -m MESSAGE] + [--allow-abort] [--allowed-prefixes [ALLOWED_PREFIXES ...]] + [-l MESSAGE_LENGTH_LIMIT] + +validates that a commit message matches the commitizen schema + +options: + -h, --help show this help message and exit + --commit-msg-file COMMIT_MSG_FILE + ask for the name of the temporal file that contains + the commit message. Using it in a git hook script: + MSG_FILE=$1 + --rev-range REV_RANGE + a range of git rev to check. e.g, master..HEAD + -d, --use-default-range + check from the default branch to HEAD. e.g, + refs/remotes/origin/master..HEAD + -m MESSAGE, --message MESSAGE + commit message that needs to be checked + --allow-abort allow empty commit messages, which typically abort a + commit + --allowed-prefixes [ALLOWED_PREFIXES ...] + allowed commit message prefixes. If the message starts + by one of these prefixes, the message won't be checked + against the regex + -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT + length limit of the commit message; 0 for no limit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_commit_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_commit_.txt new file mode 100644 index 000000000..c84243342 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_commit_.txt @@ -0,0 +1,22 @@ +usage: cz commit [-h] [--retry] [--no-retry] [--dry-run] + [--write-message-to-file FILE_PATH] [-s] [-a] [-e] + [-l MESSAGE_LENGTH_LIMIT] [--] + +create new commit + +options: + -h, --help show this help message and exit + --retry retry last commit + --no-retry skip retry if retry_after_failure is set to true + --dry-run show output to stdout, no commit, no modified files + --write-message-to-file FILE_PATH + write message to file before committing (can be + combined with --dry-run) + -s, --signoff Deprecated, use 'cz commit -- -s' instead + -a, --all 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. + -e, --edit edit the commit message before committing + -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT + length limit of the commit message; 0 for no limit + -- Positional arguments separator (recommended) diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_example_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_example_.txt new file mode 100644 index 000000000..b9bf7f84f --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_example_.txt @@ -0,0 +1,6 @@ +usage: cz example [-h] + +show commit example + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_info_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_info_.txt new file mode 100644 index 000000000..99b1ba8a4 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_info_.txt @@ -0,0 +1,6 @@ +usage: cz info [-h] + +show information about the cz + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_init_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_init_.txt new file mode 100644 index 000000000..0f72042f8 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_init_.txt @@ -0,0 +1,6 @@ +usage: cz init [-h] + +init commitizen configuration + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_ls_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_ls_.txt new file mode 100644 index 000000000..5fa8fe1f7 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_ls_.txt @@ -0,0 +1,6 @@ +usage: cz ls [-h] + +show available commitizens + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_schema_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_schema_.txt new file mode 100644 index 000000000..6666db4d4 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_schema_.txt @@ -0,0 +1,6 @@ +usage: cz schema [-h] + +show commit schema + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_version_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_version_.txt new file mode 100644 index 000000000..a194615a9 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_version_.txt @@ -0,0 +1,16 @@ +usage: cz version [-h] [-r | -p | -c | -v] [--major | --minor] + +get the version of the installed commitizen or the current project (default: +installed commitizen) + +options: + -h, --help show this help message and exit + -r, --report get system information for reporting bugs + -p, --project get the version of the current project + -c, --commitizen get the version of the installed commitizen + -v, --verbose get the version of both the installed commitizen and the + current project + --major get just the major version. Need to be used with --project + or --verbose. + --minor get just the minor version. Need to be used with --project + or --verbose. diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_bump_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_bump_.txt new file mode 100644 index 000000000..ad0a69327 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_bump_.txt @@ -0,0 +1,82 @@ +usage: cz bump [-h] [--dry-run] [--files-only] [--local-version] [--changelog] + [--no-verify] [--yes] [--tag-format TAG_FORMAT] + [--bump-message BUMP_MESSAGE] [--prerelease {alpha,beta,rc}] + [--devrelease DEVRELEASE] [--increment {MAJOR,MINOR,PATCH}] + [--increment-mode {linear,exact}] [--check-consistency] + [--annotated-tag] + [--annotated-tag-message ANNOTATED_TAG_MESSAGE] [--gpg-sign] + [--changelog-to-stdout] [--git-output-to-stderr] [--retry] + [--major-version-zero] [--template TEMPLATE] [--extra EXTRA] + [--file-name FILE_NAME] [--prerelease-offset PRERELEASE_OFFSET] + [--version-scheme {pep440,semver,semver2}] + [--version-type {pep440,semver,semver2}] + [--build-metadata BUILD_METADATA] [--get-next] + [--allow-no-commit] + [MANUAL_VERSION] + +bump semantic version based on the git log + +positional arguments: + MANUAL_VERSION bump to the given version (e.g: 1.5.3) + +options: + -h, --help show this help message and exit + --dry-run show output to stdout, no commit, no modified files + --files-only bump version in the files from the config + --local-version bump only the local version portion + --changelog, -ch generate the changelog for the newest version + --no-verify this option bypasses the pre-commit and commit-msg + hooks + --yes accept automatically questions done + --tag-format TAG_FORMAT + the format used to tag the commit and read it, use it + in existing projects, wrap around simple quotes + --bump-message BUMP_MESSAGE + template used to create the release commit, useful + when working with CI + --prerelease {alpha,beta,rc}, -pr {alpha,beta,rc} + choose type of prerelease + --devrelease DEVRELEASE, -d DEVRELEASE + specify non-negative integer for dev. release + --increment {MAJOR,MINOR,PATCH} + manually specify the desired increment + --increment-mode {linear,exact} + set the method by which the new version is chosen. + 'linear' (default) guesses the next version based on + typical linear version progression, such that bumping + of a pre-release with lower precedence than the + current pre-release phase maintains the current phase + of higher precedence. 'exact' applies the changes that + have been specified (or determined from the commit + log) without interpretation, such that the increment + and pre-release are always honored + --check-consistency, -cc + check consistency among versions defined in commitizen + configuration and version_files + --annotated-tag, -at create annotated tag instead of lightweight one + --annotated-tag-message ANNOTATED_TAG_MESSAGE, -atm ANNOTATED_TAG_MESSAGE + create annotated tag message + --gpg-sign, -s sign tag instead of lightweight one + --changelog-to-stdout + Output changelog to the stdout + --git-output-to-stderr + Redirect git output to stderr + --retry retry commit if it fails the 1st time + --major-version-zero keep major version at zero, even for breaking changes + --template TEMPLATE, -t TEMPLATE + changelog template file name (relative to the current + working directory) + --extra EXTRA, -e EXTRA + a changelog extra variable (in the form 'key=value') + --file-name FILE_NAME + file name of changelog (default: 'CHANGELOG.md') + --prerelease-offset PRERELEASE_OFFSET + start pre-releases with this offset + --version-scheme {pep440,semver,semver2} + choose version scheme + --version-type {pep440,semver,semver2} + Deprecated, use --version-scheme instead + --build-metadata BUILD_METADATA + Add additional build-metadata to the version-number + --get-next Determine the next version and write to stdout + --allow-no-commit bump version without eligible commits diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_changelog_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_changelog_.txt new file mode 100644 index 000000000..f4aa1ca2a --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_changelog_.txt @@ -0,0 +1,42 @@ +usage: cz changelog [-h] [--dry-run] [--file-name FILE_NAME] + [--unreleased-version UNRELEASED_VERSION] [--incremental] + [--start-rev START_REV] [--merge-prerelease] + [--version-scheme {pep440,semver,semver2}] + [--export-template EXPORT_TEMPLATE] [--template TEMPLATE] + [--extra EXTRA] [--tag-format TAG_FORMAT] + [rev_range] + +generate changelog (note that it will overwrite existing file) + +positional arguments: + rev_range generates changelog for the given version (e.g: 1.5.3) + or version range (e.g: 1.5.3..1.7.9) + +options: + -h, --help show this help message and exit + --dry-run show changelog to stdout + --file-name FILE_NAME + file name of changelog (default: 'CHANGELOG.md') + --unreleased-version UNRELEASED_VERSION + set the value for the new version (use the tag value), + instead of using unreleased + --incremental generates changelog from last created version, useful + if the changelog has been manually modified + --start-rev START_REV + start rev of the changelog. If not set, it will + generate changelog from the start + --merge-prerelease collect all changes from prereleases into next non- + prerelease. If not set, it will include prereleases in + the changelog + --version-scheme {pep440,semver,semver2} + choose version scheme + --export-template EXPORT_TEMPLATE + Export the changelog template into this file instead + of rendering it + --template TEMPLATE, -t TEMPLATE + changelog template file name (relative to the current + working directory) + --extra EXTRA, -e EXTRA + a changelog extra variable (in the form 'key=value') + --tag-format TAG_FORMAT + The format of the tag, wrap around simple quotes diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_check_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_check_.txt new file mode 100644 index 000000000..53c4e7ed1 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_check_.txt @@ -0,0 +1,28 @@ +usage: cz check [-h] + [--commit-msg-file COMMIT_MSG_FILE | --rev-range REV_RANGE | -d | -m MESSAGE] + [--allow-abort] [--allowed-prefixes [ALLOWED_PREFIXES ...]] + [-l MESSAGE_LENGTH_LIMIT] + +validates that a commit message matches the commitizen schema + +options: + -h, --help show this help message and exit + --commit-msg-file COMMIT_MSG_FILE + ask for the name of the temporal file that contains + the commit message. Using it in a git hook script: + MSG_FILE=$1 + --rev-range REV_RANGE + a range of git rev to check. e.g, master..HEAD + -d, --use-default-range + check from the default branch to HEAD. e.g, + refs/remotes/origin/master..HEAD + -m MESSAGE, --message MESSAGE + commit message that needs to be checked + --allow-abort allow empty commit messages, which typically abort a + commit + --allowed-prefixes [ALLOWED_PREFIXES ...] + allowed commit message prefixes. If the message starts + by one of these prefixes, the message won't be checked + against the regex + -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT + length limit of the commit message; 0 for no limit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_commit_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_commit_.txt new file mode 100644 index 000000000..c84243342 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_commit_.txt @@ -0,0 +1,22 @@ +usage: cz commit [-h] [--retry] [--no-retry] [--dry-run] + [--write-message-to-file FILE_PATH] [-s] [-a] [-e] + [-l MESSAGE_LENGTH_LIMIT] [--] + +create new commit + +options: + -h, --help show this help message and exit + --retry retry last commit + --no-retry skip retry if retry_after_failure is set to true + --dry-run show output to stdout, no commit, no modified files + --write-message-to-file FILE_PATH + write message to file before committing (can be + combined with --dry-run) + -s, --signoff Deprecated, use 'cz commit -- -s' instead + -a, --all 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. + -e, --edit edit the commit message before committing + -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT + length limit of the commit message; 0 for no limit + -- Positional arguments separator (recommended) diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_example_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_example_.txt new file mode 100644 index 000000000..b9bf7f84f --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_example_.txt @@ -0,0 +1,6 @@ +usage: cz example [-h] + +show commit example + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_info_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_info_.txt new file mode 100644 index 000000000..99b1ba8a4 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_info_.txt @@ -0,0 +1,6 @@ +usage: cz info [-h] + +show information about the cz + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_init_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_init_.txt new file mode 100644 index 000000000..0f72042f8 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_init_.txt @@ -0,0 +1,6 @@ +usage: cz init [-h] + +init commitizen configuration + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_ls_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_ls_.txt new file mode 100644 index 000000000..5fa8fe1f7 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_ls_.txt @@ -0,0 +1,6 @@ +usage: cz ls [-h] + +show available commitizens + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_schema_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_schema_.txt new file mode 100644 index 000000000..6666db4d4 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_schema_.txt @@ -0,0 +1,6 @@ +usage: cz schema [-h] + +show commit schema + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_version_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_version_.txt new file mode 100644 index 000000000..a194615a9 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_12_version_.txt @@ -0,0 +1,16 @@ +usage: cz version [-h] [-r | -p | -c | -v] [--major | --minor] + +get the version of the installed commitizen or the current project (default: +installed commitizen) + +options: + -h, --help show this help message and exit + -r, --report get system information for reporting bugs + -p, --project get the version of the current project + -c, --commitizen get the version of the installed commitizen + -v, --verbose get the version of both the installed commitizen and the + current project + --major get just the major version. Need to be used with --project + or --verbose. + --minor get just the minor version. Need to be used with --project + or --verbose. diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_bump_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_bump_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_bump_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_bump_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_changelog_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_changelog_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_changelog_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_changelog_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_check_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_check_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_check_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_check_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_commit_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_commit_.txt similarity index 100% rename from tests/commands/test_common_command/test_command_shows_description_when_use_help_option_commit_.txt rename to tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_commit_.txt diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_example_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_example_.txt new file mode 100644 index 000000000..b9bf7f84f --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_example_.txt @@ -0,0 +1,6 @@ +usage: cz example [-h] + +show commit example + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_info_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_info_.txt new file mode 100644 index 000000000..99b1ba8a4 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_info_.txt @@ -0,0 +1,6 @@ +usage: cz info [-h] + +show information about the cz + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_init_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_init_.txt new file mode 100644 index 000000000..0f72042f8 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_init_.txt @@ -0,0 +1,6 @@ +usage: cz init [-h] + +init commitizen configuration + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_ls_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_ls_.txt new file mode 100644 index 000000000..5fa8fe1f7 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_ls_.txt @@ -0,0 +1,6 @@ +usage: cz ls [-h] + +show available commitizens + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_schema_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_schema_.txt new file mode 100644 index 000000000..6666db4d4 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_schema_.txt @@ -0,0 +1,6 @@ +usage: cz schema [-h] + +show commit schema + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_version_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_version_.txt new file mode 100644 index 000000000..a194615a9 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_13_version_.txt @@ -0,0 +1,16 @@ +usage: cz version [-h] [-r | -p | -c | -v] [--major | --minor] + +get the version of the installed commitizen or the current project (default: +installed commitizen) + +options: + -h, --help show this help message and exit + -r, --report get system information for reporting bugs + -p, --project get the version of the current project + -c, --commitizen get the version of the installed commitizen + -v, --verbose get the version of both the installed commitizen and the + current project + --major get just the major version. Need to be used with --project + or --verbose. + --minor get just the minor version. Need to be used with --project + or --verbose. diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_bump_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_bump_.txt new file mode 100644 index 000000000..4cf8e6c91 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_bump_.txt @@ -0,0 +1,81 @@ +usage: cz bump [-h] [--dry-run] [--files-only] [--local-version] [--changelog] + [--no-verify] [--yes] [--tag-format TAG_FORMAT] + [--bump-message BUMP_MESSAGE] [--prerelease {alpha,beta,rc}] + [--devrelease DEVRELEASE] [--increment {MAJOR,MINOR,PATCH}] + [--increment-mode {linear,exact}] [--check-consistency] + [--annotated-tag] + [--annotated-tag-message ANNOTATED_TAG_MESSAGE] [--gpg-sign] + [--changelog-to-stdout] [--git-output-to-stderr] [--retry] + [--major-version-zero] [--template TEMPLATE] [--extra EXTRA] + [--file-name FILE_NAME] [--prerelease-offset PRERELEASE_OFFSET] + [--version-scheme {pep440,semver,semver2}] + [--version-type {pep440,semver,semver2}] + [--build-metadata BUILD_METADATA] [--get-next] + [--allow-no-commit] + [MANUAL_VERSION] + +bump semantic version based on the git log + +positional arguments: + MANUAL_VERSION bump to the given version (e.g: 1.5.3) + +options: + -h, --help show this help message and exit + --dry-run show output to stdout, no commit, no modified files + --files-only bump version in the files from the config + --local-version bump only the local version portion + --changelog, -ch generate the changelog for the newest version + --no-verify this option bypasses the pre-commit and commit-msg + hooks + --yes accept automatically questions done + --tag-format TAG_FORMAT + the format used to tag the commit and read it, use it + in existing projects, wrap around simple quotes + --bump-message BUMP_MESSAGE + template used to create the release commit, useful + when working with CI + --prerelease, -pr {alpha,beta,rc} + choose type of prerelease + --devrelease, -d DEVRELEASE + specify non-negative integer for dev. release + --increment {MAJOR,MINOR,PATCH} + manually specify the desired increment + --increment-mode {linear,exact} + set the method by which the new version is chosen. + 'linear' (default) guesses the next version based on + typical linear version progression, such that bumping + of a pre-release with lower precedence than the + current pre-release phase maintains the current phase + of higher precedence. 'exact' applies the changes that + have been specified (or determined from the commit + log) without interpretation, such that the increment + and pre-release are always honored + --check-consistency, -cc + check consistency among versions defined in commitizen + configuration and version_files + --annotated-tag, -at create annotated tag instead of lightweight one + --annotated-tag-message, -atm ANNOTATED_TAG_MESSAGE + create annotated tag message + --gpg-sign, -s sign tag instead of lightweight one + --changelog-to-stdout + Output changelog to the stdout + --git-output-to-stderr + Redirect git output to stderr + --retry retry commit if it fails the 1st time + --major-version-zero keep major version at zero, even for breaking changes + --template, -t TEMPLATE + changelog template file name (relative to the current + working directory) + --extra, -e EXTRA a changelog extra variable (in the form 'key=value') + --file-name FILE_NAME + file name of changelog (default: 'CHANGELOG.md') + --prerelease-offset PRERELEASE_OFFSET + start pre-releases with this offset + --version-scheme {pep440,semver,semver2} + choose version scheme + --version-type {pep440,semver,semver2} + Deprecated, use --version-scheme instead + --build-metadata BUILD_METADATA + Add additional build-metadata to the version-number + --get-next Determine the next version and write to stdout + --allow-no-commit bump version without eligible commits diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_changelog_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_changelog_.txt new file mode 100644 index 000000000..91b7f389b --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_changelog_.txt @@ -0,0 +1,41 @@ +usage: cz changelog [-h] [--dry-run] [--file-name FILE_NAME] + [--unreleased-version UNRELEASED_VERSION] [--incremental] + [--start-rev START_REV] [--merge-prerelease] + [--version-scheme {pep440,semver,semver2}] + [--export-template EXPORT_TEMPLATE] [--template TEMPLATE] + [--extra EXTRA] [--tag-format TAG_FORMAT] + [rev_range] + +generate changelog (note that it will overwrite existing file) + +positional arguments: + rev_range generates changelog for the given version (e.g: 1.5.3) + or version range (e.g: 1.5.3..1.7.9) + +options: + -h, --help show this help message and exit + --dry-run show changelog to stdout + --file-name FILE_NAME + file name of changelog (default: 'CHANGELOG.md') + --unreleased-version UNRELEASED_VERSION + set the value for the new version (use the tag value), + instead of using unreleased + --incremental generates changelog from last created version, useful + if the changelog has been manually modified + --start-rev START_REV + start rev of the changelog. If not set, it will + generate changelog from the start + --merge-prerelease collect all changes from prereleases into next non- + prerelease. If not set, it will include prereleases in + the changelog + --version-scheme {pep440,semver,semver2} + choose version scheme + --export-template EXPORT_TEMPLATE + Export the changelog template into this file instead + of rendering it + --template, -t TEMPLATE + changelog template file name (relative to the current + working directory) + --extra, -e EXTRA a changelog extra variable (in the form 'key=value') + --tag-format TAG_FORMAT + The format of the tag, wrap around simple quotes diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_check_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_check_.txt new file mode 100644 index 000000000..406674855 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_check_.txt @@ -0,0 +1,28 @@ +usage: cz check [-h] [--commit-msg-file COMMIT_MSG_FILE | + --rev-range REV_RANGE | -d | -m MESSAGE] [--allow-abort] + [--allowed-prefixes [ALLOWED_PREFIXES ...]] + [-l MESSAGE_LENGTH_LIMIT] + +validates that a commit message matches the commitizen schema + +options: + -h, --help show this help message and exit + --commit-msg-file COMMIT_MSG_FILE + ask for the name of the temporal file that contains + the commit message. Using it in a git hook script: + MSG_FILE=$1 + --rev-range REV_RANGE + a range of git rev to check. e.g, master..HEAD + -d, --use-default-range + check from the default branch to HEAD. e.g, + refs/remotes/origin/master..HEAD + -m, --message MESSAGE + commit message that needs to be checked + --allow-abort allow empty commit messages, which typically abort a + commit + --allowed-prefixes [ALLOWED_PREFIXES ...] + allowed commit message prefixes. If the message starts + by one of these prefixes, the message won't be checked + against the regex + -l, --message-length-limit MESSAGE_LENGTH_LIMIT + length limit of the commit message; 0 for no limit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_commit_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_commit_.txt new file mode 100644 index 000000000..ba531042a --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_commit_.txt @@ -0,0 +1,22 @@ +usage: cz commit [-h] [--retry] [--no-retry] [--dry-run] + [--write-message-to-file FILE_PATH] [-s] [-a] [-e] + [-l MESSAGE_LENGTH_LIMIT] [--] + +create new commit + +options: + -h, --help show this help message and exit + --retry retry last commit + --no-retry skip retry if retry_after_failure is set to true + --dry-run show output to stdout, no commit, no modified files + --write-message-to-file FILE_PATH + write message to file before committing (can be + combined with --dry-run) + -s, --signoff Deprecated, use 'cz commit -- -s' instead + -a, --all 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. + -e, --edit edit the commit message before committing + -l, --message-length-limit MESSAGE_LENGTH_LIMIT + length limit of the commit message; 0 for no limit + -- Positional arguments separator (recommended) diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_example_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_example_.txt new file mode 100644 index 000000000..b9bf7f84f --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_example_.txt @@ -0,0 +1,6 @@ +usage: cz example [-h] + +show commit example + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_info_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_info_.txt new file mode 100644 index 000000000..99b1ba8a4 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_info_.txt @@ -0,0 +1,6 @@ +usage: cz info [-h] + +show information about the cz + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_init_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_init_.txt new file mode 100644 index 000000000..0f72042f8 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_init_.txt @@ -0,0 +1,6 @@ +usage: cz init [-h] + +init commitizen configuration + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_ls_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_ls_.txt new file mode 100644 index 000000000..5fa8fe1f7 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_ls_.txt @@ -0,0 +1,6 @@ +usage: cz ls [-h] + +show available commitizens + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_schema_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_schema_.txt new file mode 100644 index 000000000..6666db4d4 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_schema_.txt @@ -0,0 +1,6 @@ +usage: cz schema [-h] + +show commit schema + +options: + -h, --help show this help message and exit diff --git a/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_version_.txt b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_version_.txt new file mode 100644 index 000000000..a194615a9 --- /dev/null +++ b/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_14_version_.txt @@ -0,0 +1,16 @@ +usage: cz version [-h] [-r | -p | -c | -v] [--major | --minor] + +get the version of the installed commitizen or the current project (default: +installed commitizen) + +options: + -h, --help show this help message and exit + -r, --report get system information for reporting bugs + -p, --project get the version of the current project + -c, --commitizen get the version of the installed commitizen + -v, --verbose get the version of both the installed commitizen and the + current project + --major get just the major version. Need to be used with --project + or --verbose. + --minor get just the minor version. Need to be used with --project + or --verbose. diff --git a/tests/conftest.py b/tests/conftest.py index dc68da555..a9c39aea6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,9 +2,10 @@ import os import re +import sys import tempfile from pathlib import Path -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, cast import pytest @@ -28,6 +29,7 @@ SIGNER = "GitHub Action" SIGNER_MAIL = "action@github.com" +PYTHON_VERSION = f"{sys.version_info.major}.{sys.version_info.minor}" @pytest.fixture @@ -290,3 +292,9 @@ def any_changelog_format(config: BaseConfig) -> ChangelogFormat: """For test not relying on formats specifics, use the default""" config.settings["changelog_format"] = defaults.CHANGELOG_FORMAT return get_changelog_format(config) + + +@pytest.fixture(params=[pytest.param(PYTHON_VERSION, id=f"py_{PYTHON_VERSION}")]) +def python_version(request: pytest.FixtureRequest) -> str: + """The current python version in '{major}.{minor}' format""" + return cast("str", request.param) diff --git a/uv.lock b/uv.lock index d7a1b2511..202ed0d5a 100644 --- a/uv.lock +++ b/uv.lock @@ -219,6 +219,7 @@ dev = [ { name = "ipython", version = "9.8.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "poethepoet" }, { name = "tox" }, + { name = "tox-uv" }, ] documentation = [ { name = "mkdocs" }, @@ -270,6 +271,7 @@ dev = [ { name = "ipython", specifier = ">=8.0" }, { name = "poethepoet", specifier = ">=0.34.0" }, { name = "tox", specifier = ">4" }, + { name = "tox-uv" }, ] documentation = [ { name = "mkdocs", specifier = ">=1.4.2" }, @@ -1501,6 +1503,21 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fc/cc/e09c0d663a004945f82beecd4f147053567910479314e8d01ba71e5d5dea/tox-4.32.0-py3-none-any.whl", hash = "sha256:451e81dc02ba8d1ed20efd52ee409641ae4b5d5830e008af10fe8823ef1bd551", size = 175905, upload-time = "2025-10-24T18:03:36.337Z" }, ] +[[package]] +name = "tox-uv" +version = "1.29.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "tox" }, + { name = "uv" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4f/90/06752775b8cfadba8856190f5beae9f552547e0f287e0246677972107375/tox_uv-1.29.0.tar.gz", hash = "sha256:30fa9e6ad507df49d3c6a2f88894256bcf90f18e240a00764da6ecab1db24895", size = 23427, upload-time = "2025-10-09T20:40:27.384Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5c/17/221d62937c4130b044bb437caac4181e7e13d5536bbede65264db1f0ac9f/tox_uv-1.29.0-py3-none-any.whl", hash = "sha256:b1d251286edeeb4bc4af1e24c8acfdd9404700143c2199ccdbb4ea195f7de6cc", size = 17254, upload-time = "2025-10-09T20:40:25.885Z" }, +] + [[package]] name = "traitlets" version = "5.14.3" @@ -1573,6 +1590,32 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6d/b9/4095b668ea3678bf6a0af005527f39de12fb026516fb3df17495a733b7f8/urllib3-2.6.2-py3-none-any.whl", hash = "sha256:ec21cddfe7724fc7cb4ba4bea7aa8e2ef36f607a4bab81aa6ce42a13dc3f03dd", size = 131182, upload-time = "2025-12-11T15:56:38.584Z" }, ] +[[package]] +name = "uv" +version = "0.9.20" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/61/20/c7598c4a8b0a7d19a1927287876d5fabb4ad5150103c9b751740bea33396/uv-0.9.20.tar.gz", hash = "sha256:a8b45804a84e5dfd01127abea663f7ca508551cd705e3476cc050751e5788b32", size = 3832559, upload-time = "2025-12-29T20:54:08.844Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/87/2e/ff66dbb7389f03097ff83e4d08c093f32bed96752df58b9992ec5e7aa0ea/uv-0.9.20-py3-none-linux_armv6l.whl", hash = "sha256:025ff1890f7ae2ea93a6c9ba326d25e56ba6d9e4f05c372b82ff5a947d21c400", size = 21294993, upload-time = "2025-12-29T20:54:23.877Z" }, + { url = "https://files.pythonhosted.org/packages/3f/e0/5c14ac09dfebda68df962524cd191c5a4d7e0b02ac5503c34dce6788ffe6/uv-0.9.20-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:94f716f0e6e609d8c6804faa74797024c43e7aa2ea876778fa16ceb68dc4d80a", size = 20487595, upload-time = "2025-12-29T20:54:26.506Z" }, + { url = "https://files.pythonhosted.org/packages/e9/ba/089a115a898a8729074fcc2bf00dfbf8a90ef79eadf738b531c89794528e/uv-0.9.20-py3-none-macosx_11_0_arm64.whl", hash = "sha256:288fdf29b22b3034285e244c006bcdf5575e35fe14f1f2dd55bbb477d6c22d99", size = 18972327, upload-time = "2025-12-29T20:54:31.292Z" }, + { url = "https://files.pythonhosted.org/packages/b8/9f/3a880df832196a4113ed5b16322bd6d6cc21b80338406f2bdab7cbc31361/uv-0.9.20-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:44076e26038fe37bd6aad7aaf411b72006ec01f124af3c1227d47a3fafa11b1b", size = 20825991, upload-time = "2025-12-29T20:54:21.359Z" }, + { url = "https://files.pythonhosted.org/packages/0c/c1/5b4bdc9b4637f061955200eda21d2285701b8dd979d745a9f5ac2f789abb/uv-0.9.20-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b66e83fa1558b322194a297e9477e7e49f31136f95b88830a971ba23d8778fb5", size = 20885060, upload-time = "2025-12-29T20:54:10.973Z" }, + { url = "https://files.pythonhosted.org/packages/4d/11/9c44cea9b30dda6a9268d3496aae0c83afa6096afa83559de33181877ab8/uv-0.9.20-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9ae848f6760fce321a2be6cc98b37a31353178295c9e0ebb64e70be8a3c73b07", size = 21992898, upload-time = "2025-12-29T20:54:49.959Z" }, + { url = "https://files.pythonhosted.org/packages/f1/dd/6d5eaefec10ef5aceeb0957ebd49afede80c446354ecb463cc8f457144da/uv-0.9.20-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:47cda4b2dcdfb55fb4d77fe3ef138d30e89d69e138e96c30325509462e4c4386", size = 23540946, upload-time = "2025-12-29T20:54:15.976Z" }, + { url = "https://files.pythonhosted.org/packages/df/87/a8ce66e5ee35351a2c50f9cf125407e582e1d790e78cad79b614944f3f4a/uv-0.9.20-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7551cd1a3a1516583021d43b2daef41ce36c2249aa19de10c0f108264099388", size = 23156794, upload-time = "2025-12-29T20:54:03.745Z" }, + { url = "https://files.pythonhosted.org/packages/c4/43/ca9653caba6123f83842ac81de2411316570fda3b7a5916c2b1ef858ab5a/uv-0.9.20-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:143783954e48abaea83d100eb7ca70a614c089d5933b55d59a5638d630b3f7c3", size = 22225527, upload-time = "2025-12-29T20:54:06.663Z" }, + { url = "https://files.pythonhosted.org/packages/f3/a4/f88d4e6806894a37b4018edfd196cd3689194e6ecbcee05fd7ae5ed4cf6f/uv-0.9.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d86724ae303c80d52712b335cfc9f1b5aa785244c18905fd605067303a305854", size = 22205705, upload-time = "2025-12-29T20:54:44.766Z" }, + { url = "https://files.pythonhosted.org/packages/3d/bc/202cfb8d47f83b633502b0b32e00abc019f91255e54aa6672a87495ef06c/uv-0.9.20-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:19e4ce680230f9148c777af4664a6a534821222dd4e8f06844c3d23b79e4778b", size = 20943437, upload-time = "2025-12-29T20:54:34.237Z" }, + { url = "https://files.pythonhosted.org/packages/a3/15/de8ecbf504c96cfb5af7fdf621e5497f0496a403d0883c31ee97702b97db/uv-0.9.20-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:02383c09eadd2518afb0eebbc651d74b2dd59ad5818d28037cbf7bcef76f8b56", size = 22071434, upload-time = "2025-12-29T20:54:47.395Z" }, + { url = "https://files.pythonhosted.org/packages/30/32/283604c72142e4550f04252d53ab591ed71a178ae044b3debbea1700018c/uv-0.9.20-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:277a7fc7e5229a809e6cc4dacc936dea1fa7260fb5802895ddbba0873fc4b6ec", size = 20838373, upload-time = "2025-12-29T20:54:28.975Z" }, + { url = "https://files.pythonhosted.org/packages/c4/d4/c56a14ae2a693260d227e60358f09f924b7e347bed4aef7a85f4d52e06f5/uv-0.9.20-py3-none-musllinux_1_1_i686.whl", hash = "sha256:c9a073116da198b0533e80828d765bbb30137eef37de68cbc3d21b0f614c843d", size = 21399009, upload-time = "2025-12-29T20:54:13.458Z" }, + { url = "https://files.pythonhosted.org/packages/99/35/e717a53df2d579fd57e9236ef3e13d9127c34e006c6ea1bb4294164d04df/uv-0.9.20-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:56bb00bc0d13f9e4913ef773f31659423faaffe408f6c24b24e25f2c1d5a93cf", size = 22426264, upload-time = "2025-12-29T20:54:37.053Z" }, + { url = "https://files.pythonhosted.org/packages/d4/18/563fc6703e882167b39270db83a57e36834b0d75a51c97a9e5e30a5b2a47/uv-0.9.20-py3-none-win32.whl", hash = "sha256:e620adcbd2e6d714e26928c1674af4581ba9e4b74c38745d6987b4d323d80edc", size = 20034131, upload-time = "2025-12-29T20:54:39.386Z" }, + { url = "https://files.pythonhosted.org/packages/c8/32/3359f7afeebadcaa472535f72ca48dc2d7f234de8570039ee556b470734e/uv-0.9.20-py3-none-win_amd64.whl", hash = "sha256:42d43b6cb7d84a3d4fce8a8a46f0b2c6c8b5d58b3b8062980cbfdb65b559fa8f", size = 22203935, upload-time = "2025-12-29T20:54:18.997Z" }, + { url = "https://files.pythonhosted.org/packages/b8/c4/65fd3981884a51971135547ebb0dddc5c32161374f90e162aca227f4832f/uv-0.9.20-py3-none-win_arm64.whl", hash = "sha256:d63f501a95ef74ea6d2004665eb2ae65429d039150f2c2e6bc12efb6e03fd702", size = 20578093, upload-time = "2025-12-29T20:54:41.944Z" }, +] + [[package]] name = "virtualenv" version = "20.35.4"