diff --git a/commitizen/cli.py b/commitizen/cli.py index 12db01711c..6f7556df49 100644 --- a/commitizen/cli.py +++ b/commitizen/cli.py @@ -147,7 +147,7 @@ def __call__( { "name": ["-s", "--signoff"], "action": "store_true", - "help": "sign off the commit", + "help": "Deprecated, use 'cz commit -- -s' instead", }, { "name": ["-a", "--all"], @@ -347,7 +347,7 @@ def __call__( }, { "name": ["--version-type"], - "help": "Deprecated, use --version-scheme", + "help": "Deprecated, use --version-scheme instead", "default": None, "choices": version_schemes.KNOWN_SCHEMES, }, diff --git a/commitizen/commands/commit.py b/commitizen/commands/commit.py index 43feb272ba..bb4c2fdc94 100644 --- a/commitizen/commands/commit.py +++ b/commitizen/commands/commit.py @@ -125,6 +125,11 @@ def __call__(self) -> None: write_message_to_file = self.arguments.get("write_message_to_file") signoff = bool(self.arguments.get("signoff")) + if signoff: + out.warn( + "Deprecated warning: `cz commit -s` is deprecated and will be removed in v5, please use `cz commit -- -s` instead." + ) + if self.arguments.get("all"): git.add("-u") @@ -147,11 +152,6 @@ def __call__(self) -> None: if dry_run: raise DryRunExit() - if signoff: - out.warn( - "signoff mechanic is deprecated, please use `cz commit -- -s` instead." - ) - if self.config.settings["always_signoff"] or signoff: extra_args = f"{extra_args} -s".strip() diff --git a/tests/commands/test_bump_command/test_bump_command_shows_description_when_use_help_option.txt b/tests/commands/test_bump_command/test_bump_command_shows_description_when_use_help_option.txt index 5d4438875d..4cf8e6c91b 100644 --- a/tests/commands/test_bump_command/test_bump_command_shows_description_when_use_help_option.txt +++ b/tests/commands/test_bump_command/test_bump_command_shows_description_when_use_help_option.txt @@ -74,7 +74,7 @@ options: --version-scheme {pep440,semver,semver2} choose version scheme --version-type {pep440,semver,semver2} - Deprecated, use --version-scheme + 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 diff --git a/tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt b/tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt index dd1f53f3da..ba531042aa 100644 --- a/tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt +++ b/tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt @@ -12,7 +12,7 @@ options: --write-message-to-file FILE_PATH write message to file before committing (can be combined with --dry-run) - -s, --signoff sign off the commit + -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.