mirror of
https://github.com/drewcassidy/yaclog.git
synced 2024-09-01 14:58:58 +00:00
Bug fixes and readme
This commit is contained in:
parent
0bf63f1501
commit
a3ad83ec32
@ -4,10 +4,19 @@ All notable changes to this project will be documented in this file
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Readme file now has installation and usage instructions
|
||||||
|
- yaclog command entry point added to setup.cfg
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- `release -c` will no longer create empty commits, and will use the current commit instead
|
- `release -c` will no longer create empty commits, and will use the current commit instead
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- `release` and `entry` commands now work using empty changelogs
|
||||||
|
|
||||||
## 0.3.1 - 2021-04-24
|
## 0.3.1 - 2021-04-24
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
69
README.md
69
README.md
@ -3,4 +3,71 @@ Yet another changelog command line tool
|
|||||||
|
|
||||||
![a yak who is a log](https://github.com/drewcassidy/yaclog/raw/main/logo.png)
|
![a yak who is a log](https://github.com/drewcassidy/yaclog/raw/main/logo.png)
|
||||||
|
|
||||||
*Logo by Erin Cassidy*
|
*Logo by Erin Cassidy*
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Install and update using [pip](https://pip.pypa.io/en/stable/quickstart/):
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ pip install -U yaclog
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
For usage from the command line, yaclog provides the `yaclog` command:
|
||||||
|
```
|
||||||
|
Usage: yaclog [OPTIONS] COMMAND [ARGS]...
|
||||||
|
|
||||||
|
Manipulate markdown changelog files.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--path FILE Location of the changelog file. [default: CHANGELOG.md]
|
||||||
|
--version Show the version and exit.
|
||||||
|
--help Show this message and exit.
|
||||||
|
|
||||||
|
Commands:
|
||||||
|
entry Add entries to the changelog.
|
||||||
|
format Reformat the changelog file.
|
||||||
|
init Create a new changelog file.
|
||||||
|
release Release versions.
|
||||||
|
show Show changes from the changelog file
|
||||||
|
tag Modify version tags
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example workflow
|
||||||
|
|
||||||
|
Create a new changelog:
|
||||||
|
```shell
|
||||||
|
$ yaclog init
|
||||||
|
```
|
||||||
|
|
||||||
|
Add some new entries to the "Added" section of the current unreleased version:
|
||||||
|
```shell
|
||||||
|
$ yaclog entry -b 'Introduced some more bugs'
|
||||||
|
$ yaclog entry -b 'Introduced some more features'
|
||||||
|
```
|
||||||
|
|
||||||
|
Show the current version:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ yaclog show
|
||||||
|
```
|
||||||
|
```
|
||||||
|
Unreleased
|
||||||
|
|
||||||
|
- Introduced some more bugs
|
||||||
|
- Introduced some more features
|
||||||
|
```
|
||||||
|
|
||||||
|
Release the current version and make a git tag for it
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ yaclog release --version 0.0.1 -c
|
||||||
|
```
|
||||||
|
```
|
||||||
|
Renamed version "Unreleased" to "0.0.1".
|
||||||
|
Commit and create tag for version 0.0.1? [y/N]: y
|
||||||
|
Created commit a7b6789
|
||||||
|
Created tag "0.0.1".
|
||||||
|
```
|
||||||
|
@ -33,3 +33,7 @@ install_requires =
|
|||||||
packaging >= 20
|
packaging >= 20
|
||||||
python_requires = >= 3.8
|
python_requires = >= 3.8
|
||||||
packages = find:
|
packages = find:
|
||||||
|
|
||||||
|
[options.entry_points]
|
||||||
|
console_scripts =
|
||||||
|
yaclog = yaclog.cli.__main__:cli
|
||||||
|
@ -139,10 +139,12 @@ def entry(obj: Changelog, bullets, paragraphs, section_name, version_name):
|
|||||||
raise click.BadArgumentUsage(f'Version "{version_name}" not found in changelog.')
|
raise click.BadArgumentUsage(f'Version "{version_name}" not found in changelog.')
|
||||||
version = matches[0]
|
version = matches[0]
|
||||||
else:
|
else:
|
||||||
version = obj.versions[0]
|
matches = [v for v in obj.versions if v.name.lower() == 'unreleased']
|
||||||
if version.name.lower() != 'unreleased':
|
if len(matches) == 0:
|
||||||
version = yaclog.changelog.VersionEntry()
|
version = yaclog.changelog.VersionEntry()
|
||||||
obj.versions.insert(0, version)
|
obj.versions.insert(0, version)
|
||||||
|
else:
|
||||||
|
version = matches[0]
|
||||||
|
|
||||||
if section_name not in version.sections.keys():
|
if section_name not in version.sections.keys():
|
||||||
version.sections[section_name] = []
|
version.sections[section_name] = []
|
||||||
@ -167,7 +169,7 @@ def entry(obj: Changelog, bullets, paragraphs, section_name, version_name):
|
|||||||
obj.write()
|
obj.write()
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command(short_help='Release versions.')
|
||||||
@click.option('-v', '--version', 'v_flag', type=str, default=None, help='The new version number to use.')
|
@click.option('-v', '--version', 'v_flag', type=str, default=None, help='The new version number to use.')
|
||||||
@click.option('-M', '--major', 'v_flag', flag_value='+M', help='Increment major version number.')
|
@click.option('-M', '--major', 'v_flag', flag_value='+M', help='Increment major version number.')
|
||||||
@click.option('-m', '--minor', 'v_flag', flag_value='+m', help='Increment minor version number.')
|
@click.option('-m', '--minor', 'v_flag', flag_value='+m', help='Increment minor version number.')
|
||||||
|
Loading…
Reference in New Issue
Block a user