Skip to content

Commit 80d0811

Browse files
schlotterLee-W
authored andcommitted
feat(defaults.py): add always_signoff config option for commits
Add new configuration option `always_signoff`. When is set to `true`, commits will be always signed off. The `-s` option does not have to specified to `cz commit`. Signed-off-by: Christian Schlotter <christian.schlotter@zeiss.com> #785
1 parent bab4831 commit 80d0811

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

commitizen/commands/commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __call__(self):
8989
if dry_run:
9090
raise DryRunExit()
9191

92-
signoff: bool = self.arguments.get("signoff")
92+
signoff: bool = self.arguments.get("signoff") or self.config.settings["always_signoff"]
9393

9494
if signoff:
9595
c = git.commit(m, "-s")

commitizen/defaults.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class Settings(TypedDict, total=False):
5656
post_bump_hooks: list[str] | None
5757
prerelease_offset: int
5858
encoding: str
59+
always_signoff: bool
5960

6061

6162
name: str = "cz_conventional_commits"
@@ -96,6 +97,7 @@ class Settings(TypedDict, total=False):
9697
"post_bump_hooks": [],
9798
"prerelease_offset": 0,
9899
"encoding": encoding,
100+
"always_signoff": False,
99101
}
100102

101103
MAJOR = "MAJOR"

0 commit comments

Comments
 (0)