Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow None as git tag prefix #15

Merged
merged 3 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.2.2] - 2023-03-27

### Added

- Added possibility to supply 'None' for empty git tag prefix

### Fixed

- Fix passing git tag prefix to check changelog

## [0.2.1] - 2023-03-24

### Fixed
Expand Down Expand Up @@ -39,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Initial release

[0.2.2]: https://github.com/dobraczka/recite/releases/tag/v0.2.2
[0.2.1]: https://github.com/dobraczka/recite/releases/tag/v0.2.1
[0.2.0]: https://github.com/dobraczka/recite/releases/tag/v0.2.0
[0.1.1]: https://github.com/dobraczka/recite/releases/tag/v0.1.1
Expand Down
18 changes: 14 additions & 4 deletions src/recite/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
app = typer.Typer()


def _setup(allow_untracked_files: bool = False, skip_checks: Optional[str] = None):
def _setup(
git_tag_prefix: str = "",
allow_untracked_files: bool = False,
skip_checks: Optional[str] = None,
):
project_dir = os.getcwd()
console = ReciteConsole()
checks = CheckStepRunner(
Expand All @@ -34,7 +38,7 @@ def _setup(allow_untracked_files: bool = False, skip_checks: Optional[str] = Non
project_dir=project_dir, allow_untracked_files=allow_untracked_files
),
RunTestsStep(),
CheckChangelogStep(project_dir=project_dir),
CheckChangelogStep(project_dir=project_dir, prefix=git_tag_prefix),
],
console=console,
skip_steps=skip_checks,
Expand All @@ -60,14 +64,20 @@ def release(
commit_message: str = typer.Option(
"Bumped version", help="Commit message for version bump"
),
git_tag_prefix: str = typer.Option("v", help="Prefix for git tag"),
git_tag_prefix: str = typer.Option(
"v", help="Prefix for git tag, write 'None' to set it to empty string"
),
skip_checks: str = typer.Option(
None,
help="Comma-seperated list of checks referenced by their shortnames. You can print a list of checks with 'recite list-checks'",
),
):
if git_tag_prefix == "None":
git_tag_prefix = ""
project_dir, console, checks = _setup(
allow_untracked_files=allow_untracked_files, skip_checks=skip_checks
allow_untracked_files=allow_untracked_files,
skip_checks=skip_checks,
git_tag_prefix=git_tag_prefix,
)
successful = checks.run_steps()
if not successful:
Expand Down