Skip to content

Commit df255d0

Browse files
add no commitizen flag in ap commit
1 parent 0bce056 commit df255d0

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

afterpython/cli/commands/commit.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import subprocess
23

34
import click
@@ -11,6 +12,14 @@
1112
),
1213
)
1314
@click.pass_context
14-
def commit(ctx):
15+
@click.option(
16+
"--no-cz", "--no-commitizen", is_flag=True, help="Skip running 'cz commit'"
17+
)
18+
def commit(ctx, no_cz: bool):
1519
"""Run 'cz commit'"""
16-
subprocess.run(["ap", "cz", "commit", *ctx.args])
20+
if not no_cz:
21+
subprocess.run(["ap", "cz", "commit", *ctx.args])
22+
else:
23+
env = os.environ.copy()
24+
env["SKIP"] = "commitizen,commitizen-branch"
25+
subprocess.run(["git", "commit", *ctx.args], env=env)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies = [
4242
"pyproject-metadata>=0.9.1",
4343
# "jupytext>=1.18.1",
4444
# "jinja2>=3.1.6",
45-
"mystmd>=1.6.4",
45+
"mystmd>=1.6.6",
4646
"pdoc>=16.0.0",
4747
"ruff>=0.14.5",
4848
"pre-commit>=4.4.0",

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)