Skip to content

Commit

Permalink
Merge pull request #8 from Colin-b/develop
Browse files Browse the repository at this point in the history
Release 0.3.0
  • Loading branch information
Colin-b committed Mar 1, 2020
2 parents 998fd84 + c285b93 commit cdef3d0
Show file tree
Hide file tree
Showing 13 changed files with 229 additions and 126 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.0] - 2020-03-01
### Changed
- Information is now stored without star, space or caret at start or end of line.

## [0.2.0] - 2020-02-24
### Added
- It is now possible to retrieve "Unreleased" information thanks to the `show_unreleased` parameter. (Thanks [Alessandro Ogier](https://github.com/aogier))
Expand All @@ -18,7 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial release.

[Unreleased]: https://github.com/Colin-b/keepachangelog/compare/v0.2.0...HEAD
[Unreleased]: https://github.com/Colin-b/keepachangelog/compare/v0.3.0...HEAD
[0.3.0]: https://github.com/Colin-b/keepachangelog/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/Colin-b/keepachangelog/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/Colin-b/keepachangelog/compare/v0.0.1...v0.1.0
[0.0.1]: https://github.com/Colin-b/keepachangelog/releases/tag/v0.0.1
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://travis-ci.org/Colin-b/keepachangelog"><img alt="Build status" src="https://api.travis-ci.org/Colin-b/keepachangelog.svg?branch=master"></a>
<a href="https://travis-ci.org/Colin-b/keepachangelog"><img alt="Coverage" src="https://img.shields.io/badge/coverage-100%25-brightgreen"></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="https://travis-ci.org/Colin-b/keepachangelog"><img alt="Number of tests" src="https://img.shields.io/badge/tests-11 passed-blue"></a>
<a href="https://travis-ci.org/Colin-b/keepachangelog"><img alt="Number of tests" src="https://img.shields.io/badge/tests-12 passed-blue"></a>
<a href="https://pypi.org/project/keepachangelog/"><img alt="Number of downloads" src="https://img.shields.io/pypi/dm/keepachangelog"></a>
</p>

Expand All @@ -23,26 +23,26 @@ changes = keepachangelog.to_dict("path/to/CHANGELOG.md")
changes = {
"1.1.0": {
"changed": [
"- Enhancement 1 (1.1.0)",
"- sub enhancement 1",
"- sub enhancement 2",
"- Enhancement 2 (1.1.0)",
"Enhancement 1 (1.1.0)",
"sub enhancement 1",
"sub enhancement 2",
"Enhancement 2 (1.1.0)",
],
"release_date": "2018-05-31",
"version": "1.1.0",
},
"1.0.1": {
"fixed": [
"- Bug fix 1 (1.0.1)",
"- sub bug 1",
"- sub bug 2",
"- Bug fix 2 (1.0.1)",
"Bug fix 1 (1.0.1)",
"sub bug 1",
"sub bug 2",
"Bug fix 2 (1.0.1)",
],
"release_date": "2018-05-31",
"version": "1.0.1",
},
"1.0.0": {
"deprecated": ["- Known issue 1 (1.0.0)", "- Known issue 2 (1.0.0)"],
"deprecated": ["Known issue 1 (1.0.0)", "Known issue 2 (1.0.0)"],
"release_date": "2017-04-10",
"version": "1.0.0",
},
Expand All @@ -65,14 +65,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Enhancement 1
- sub enhancement 1
- sub enhancement 2
- sub enhancement 1
- sub enhancement 2
- Enhancement 2

### Fixed
- Bug fix 1
- sub bug 1
- sub bug 2
- sub bug 1
- sub bug 2
- Bug fix 2

### Security
Expand All @@ -90,15 +90,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.1.0] - 2018-05-31
### Changed
- Enhancement 1 (1.1.0)
- sub enhancement 1
- sub enhancement 2
- sub enhancement 1
- sub enhancement 2
- Enhancement 2 (1.1.0)

## [1.0.1] - 2018-05-31
### Fixed
- Bug fix 1 (1.0.1)
- sub bug 1
- sub bug 2
- sub bug 1
- sub bug 2
- Bug fix 2 (1.0.1)

## [1.0.0] - 2017-04-10
Expand Down
2 changes: 1 addition & 1 deletion keepachangelog/_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def is_information(line: str) -> bool:


def add_information(category: List[str], line: str):
category.append(line)
category.append(line.strip(" *-"))


def to_dict(changelog_path: str, *, show_unreleased: bool = False) -> Dict[str, dict]:
Expand Down
2 changes: 1 addition & 1 deletion keepachangelog/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Major should be incremented in case there is a breaking change. (eg: 2.5.8 -> 3.0.0)
# Minor should be incremented in case there is an enhancement. (eg: 2.5.8 -> 2.6.0)
# Patch should be incremented in case there is a bug fix. (eg: 2.5.8 -> 2.5.9)
__version__ = "0.2.0"
__version__ = "0.3.0"
35 changes: 26 additions & 9 deletions tests/test_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def changelog(tmpdir):
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.2.0] - 2018-06-01
### Changed
- Release note 1.
- Release note 2.
Expand Down Expand Up @@ -76,28 +78,43 @@ def changelog(tmpdir):

def test_changelog_with_versions_and_all_categories(changelog):
assert keepachangelog.to_dict(changelog) == {
"1.2.0": {
"added": [
"Enhancement 1",
"sub enhancement 1",
"sub enhancement 2",
"Enhancement 2",
],
"changed": ["Release note 1.", "Release note 2."],
"deprecated": ["Deprecated feature 1", "Future removal 2"],
"fixed": ["Bug fix 1", "sub bug 1", "sub bug 2", "Bug fix 2"],
"release_date": "2018-06-01",
"removed": ["Deprecated feature 2", "Future removal 1"],
"security": ["Known issue 1", "Known issue 2"],
"version": "1.2.0",
},
"1.1.0": {
"changed": [
"- Enhancement 1 (1.1.0)",
"- sub enhancement 1",
"- sub enhancement 2",
"- Enhancement 2 (1.1.0)",
"Enhancement 1 (1.1.0)",
"sub enhancement 1",
"sub enhancement 2",
"Enhancement 2 (1.1.0)",
],
"release_date": "2018-05-31",
"version": "1.1.0",
},
"1.0.1": {
"fixed": [
"- Bug fix 1 (1.0.1)",
"- sub bug 1",
"- sub bug 2",
"- Bug fix 2 (1.0.1)",
"Bug fix 1 (1.0.1)",
"sub bug 1",
"sub bug 2",
"Bug fix 2 (1.0.1)",
],
"release_date": "2018-05-31",
"version": "1.0.1",
},
"1.0.0": {
"deprecated": ["- Known issue 1 (1.0.0)", "- Known issue 2 (1.0.0)"],
"deprecated": ["Known issue 1 (1.0.0)", "Known issue 2 (1.0.0)"],
"release_date": "2017-04-10",
"version": "1.0.0",
},
Expand Down
29 changes: 20 additions & 9 deletions tests/test_changelog_no_added.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def changelog(tmpdir):
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.2.0] - 2018-06-01
### Changed
- Release note 1.
- Release note 2.
Expand Down Expand Up @@ -65,28 +67,37 @@ def changelog(tmpdir):

def test_changelog_with_versions_and_no_added(changelog):
assert keepachangelog.to_dict(changelog) == {
"1.2.0": {
"changed": ["Release note 1.", "Release note 2."],
"deprecated": ["Deprecated feature 1", "Future removal 2"],
"fixed": ["Bug fix 1", "sub bug 1", "sub bug 2", "Bug fix 2"],
"release_date": "2018-06-01",
"removed": ["Deprecated feature 2", "Future removal 1"],
"security": ["Known issue 1", "Known issue 2"],
"version": "1.2.0",
},
"1.1.0": {
"changed": [
"- Enhancement 1 (1.1.0)",
"- sub enhancement 1",
"- sub enhancement 2",
"- Enhancement 2 (1.1.0)",
"Enhancement 1 (1.1.0)",
"sub enhancement 1",
"sub enhancement 2",
"Enhancement 2 (1.1.0)",
],
"release_date": "2018-05-31",
"version": "1.1.0",
},
"1.0.1": {
"fixed": [
"- Bug fix 1 (1.0.1)",
"- sub bug 1",
"- sub bug 2",
"- Bug fix 2 (1.0.1)",
"Bug fix 1 (1.0.1)",
"sub bug 1",
"sub bug 2",
"Bug fix 2 (1.0.1)",
],
"release_date": "2018-05-31",
"version": "1.0.1",
},
"1.0.0": {
"deprecated": ["- Known issue 1 (1.0.0)", "- Known issue 2 (1.0.0)"],
"deprecated": ["Known issue 1 (1.0.0)", "Known issue 2 (1.0.0)"],
"release_date": "2017-04-10",
"version": "1.0.0",
},
Expand Down
26 changes: 21 additions & 5 deletions tests/test_changelog_no_changed.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def changelog(tmpdir):
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.2.0] - 2018-06-01
### Added
- Enhancement 1
- sub enhancement 1
Expand Down Expand Up @@ -62,19 +64,33 @@ def changelog(tmpdir):

def test_changelog_with_versions_and_no_changed(changelog):
assert keepachangelog.to_dict(changelog) == {
"1.2.0": {
"added": [
"Enhancement 1",
"sub enhancement 1",
"sub enhancement 2",
"Enhancement 2",
],
"deprecated": ["Deprecated feature 1", "Future removal 2"],
"fixed": ["Bug fix 1", "sub bug 1", "sub bug 2", "Bug fix 2"],
"release_date": "2018-06-01",
"removed": ["Deprecated feature 2", "Future removal 1"],
"security": ["Known issue 1", "Known issue 2"],
"version": "1.2.0",
},
"1.1.0": {"release_date": "2018-05-31", "version": "1.1.0"},
"1.0.1": {
"fixed": [
"- Bug fix 1 (1.0.1)",
"- sub bug 1",
"- sub bug 2",
"- Bug fix 2 (1.0.1)",
"Bug fix 1 (1.0.1)",
"sub bug 1",
"sub bug 2",
"Bug fix 2 (1.0.1)",
],
"release_date": "2018-05-31",
"version": "1.0.1",
},
"1.0.0": {
"deprecated": ["- Known issue 1 (1.0.0)", "- Known issue 2 (1.0.0)"],
"deprecated": ["Known issue 1 (1.0.0)", "Known issue 2 (1.0.0)"],
"release_date": "2017-04-10",
"version": "1.0.0",
},
Expand Down
32 changes: 24 additions & 8 deletions tests/test_changelog_no_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def changelog(tmpdir):
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.2.0] - 2018-06-01
### Changed
- Release note 1.
- Release note 2.
Expand Down Expand Up @@ -64,22 +66,36 @@ def changelog(tmpdir):

def test_changelog_with_versions_and_no_deprecated(changelog):
assert keepachangelog.to_dict(changelog) == {
"1.2.0": {
"added": [
"Enhancement 1",
"sub enhancement 1",
"sub enhancement 2",
"Enhancement 2",
],
"changed": ["Release note 1.", "Release note 2."],
"fixed": ["Bug fix 1", "sub bug 1", "sub bug 2", "Bug fix 2"],
"release_date": "2018-06-01",
"removed": ["Deprecated feature 2", "Future removal 1"],
"security": ["Known issue 1", "Known issue 2"],
"version": "1.2.0",
},
"1.1.0": {
"changed": [
"- Enhancement 1 (1.1.0)",
"- sub enhancement 1",
"- sub enhancement 2",
"- Enhancement 2 (1.1.0)",
"Enhancement 1 (1.1.0)",
"sub enhancement 1",
"sub enhancement 2",
"Enhancement 2 (1.1.0)",
],
"release_date": "2018-05-31",
"version": "1.1.0",
},
"1.0.1": {
"fixed": [
"- Bug fix 1 (1.0.1)",
"- sub bug 1",
"- sub bug 2",
"- Bug fix 2 (1.0.1)",
"Bug fix 1 (1.0.1)",
"sub bug 1",
"sub bug 2",
"Bug fix 2 (1.0.1)",
],
"release_date": "2018-05-31",
"version": "1.0.1",
Expand Down
Loading

0 comments on commit cdef3d0

Please sign in to comment.