Skip to content

Commit 56090f5

Browse files
committed
fix: cli now uses only the name of the workflow file even if a whole path was given
1 parent 5d699fb commit 56090f5

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/ci_starter/cli/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .. import (
1616
generate_reusable_workflow as generate_reusable_workflow,
1717
)
18+
from ..constants import MAX_HELP_CONTENT_WIDTH
1819
from ..errors import CiStarterError
1920
from ..logging_conf import logging_configuration
2021
from ..presets import (
@@ -35,7 +36,10 @@
3536
entry_point_name = "ci-start"
3637

3738

38-
@group(name=entry_point_name)
39+
@group(
40+
name=entry_point_name,
41+
context_settings={"show_default": True, "max_content_width": MAX_HELP_CONTENT_WIDTH},
42+
)
3943
@version_option()
4044
@option(
4145
"-C",
@@ -53,7 +57,7 @@ def cli(
5357
context.obj = workdir
5458

5559

56-
@cli.command()
60+
@cli.command(short_help="Create configuration file for python-semantic-release")
5761
@pass_obj
5862
def psr_config(workdir):
5963
logger.debug("Psr-config got workdir %s", workdir)
@@ -64,13 +68,14 @@ def psr_config(workdir):
6468
exit(err.code)
6569

6670

67-
@cli.command()
71+
@cli.command(short_help="Create workflow files")
6872
@option("-m", "--module-name")
6973
@option(
7074
"--workflow-file-name",
7175
default="continuous-delivery.yml",
7276
type=ClickPath(writable=True, path_type=Path),
7377
callback=validate_workflow_file_name,
78+
help="Name of the main workflow file",
7479
)
7580
@option("--test-group", default="test", callback=validate_test_group)
7681
@option("--test-command", default="uv run -- pytest --verbose")
@@ -97,7 +102,7 @@ def workflows(
97102
script: str = generate_helper_script()
98103
script_file.write(script)
99104

100-
base_workflow_file = workdir.workflows / workflow_file_name
105+
base_workflow_file = workdir.workflows / workflow_file_name.name
101106
with base_workflow_file.open("w", encoding="utf-8") as base_workflow:
102107
cli_settable_vars = {
103108
"package_name": get_package_name(workdir.pyproject_toml),
@@ -123,7 +128,7 @@ def workflows(
123128
dump(data, file)
124129

125130

126-
@cli.command("update-actions")
131+
@cli.command("update-actions", short_help="Update GitHub Action versions used in the workflow files")
127132
@pass_obj
128133
def update_actions_cli(workdir):
129134
logger.debug("Update-actions got workdir %s", workdir)

src/ci_starter/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from pathlib import Path
22

3+
MAX_HELP_CONTENT_WIDTH = 120
4+
35
WORKFLOWS_DIR_NAME = "workflows"
46
GITHUB_WORKFLOWS_DIR = f".github/{WORKFLOWS_DIR_NAME}"
57

0 commit comments

Comments
 (0)