From e85cb289346e0fa938f591a75f10d88adf271215 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 2 Jun 2025 01:16:21 +0800 Subject: [PATCH] fix(deprecated): mark deprecate in v5 --- commitizen/commands/bump.py | 2 +- commitizen/defaults.py | 2 +- commitizen/version_schemes.py | 2 +- docs/commands/commit.md | 2 +- tests/test_defaults.py | 4 +--- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/commitizen/commands/bump.py b/commitizen/commands/bump.py index a2d98c2451..3f909d97cb 100644 --- a/commitizen/commands/bump.py +++ b/commitizen/commands/bump.py @@ -82,7 +82,7 @@ def __init__(self, config: BaseConfig, arguments: dict): if deprecated_version_type: warnings.warn( DeprecationWarning( - "`--version-type` parameter is deprecated and will be removed in commitizen 4. " + "`--version-type` parameter is deprecated and will be removed in v5. " "Please use `--version-scheme` instead" ) ) diff --git a/commitizen/defaults.py b/commitizen/defaults.py index 10d55b8621..adbb9e6d1a 100644 --- a/commitizen/defaults.py +++ b/commitizen/defaults.py @@ -175,7 +175,7 @@ def __getattr__(name: str) -> Any: if name in deprecated_vars: value, replacement = deprecated_vars[name] warnings.warn( - f"{name} is deprecated and will be removed in a future version. " + f"{name} is deprecated and will be removed in v5. " f"Use {replacement} instead.", DeprecationWarning, stacklevel=2, diff --git a/commitizen/version_schemes.py b/commitizen/version_schemes.py index d5370b2c6c..2a5f7dc6e0 100644 --- a/commitizen/version_schemes.py +++ b/commitizen/version_schemes.py @@ -419,7 +419,7 @@ def get_version_scheme(settings: Settings, name: str | None = None) -> VersionSc if deprecated_setting: warnings.warn( DeprecationWarning( - "`version_type` setting is deprecated and will be removed in commitizen 4. " + "`version_type` setting is deprecated and will be removed in v5. " "Please use `version_scheme` instead" ) ) diff --git a/docs/commands/commit.md b/docs/commands/commit.md index 5a073a2644..be9d193b97 100644 --- a/docs/commands/commit.md +++ b/docs/commands/commit.md @@ -42,7 +42,7 @@ cz c -a -- -n # Stage all changes and skip the pre-commit and commit- ``` !!! warning - The `--signoff` option (or `-s`) is now recommended being used with the new syntax: `cz commit -- -s`. The old syntax `cz commit --signoff` is deprecated. + The `--signoff` option (or `-s`) is now recommended being used with the new syntax: `cz commit -- -s`. The old syntax `cz commit --signoff` is deprecated and will be removed in v5. ### Retry diff --git a/tests/test_defaults.py b/tests/test_defaults.py index 2298068662..73cd35b80c 100644 --- a/tests/test_defaults.py +++ b/tests/test_defaults.py @@ -19,9 +19,7 @@ def test_getattr_deprecated_vars(): # Verify warning messages assert len(record) == 7 for warning in record: - assert "is deprecated and will be removed in a future version" in str( - warning.message - ) + assert "is deprecated and will be removed" in str(warning.message) def test_getattr_non_existent():