Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

More compliant Keep a Changelog parser #170

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

colincasey
Copy link
Contributor

This is still a work-in-progress but it's my first pass at addressing #153 with an alternative parser that is more compliant with the documented format.

It takes in the content of a changelog that should be in a flattened structure like the following:

# Changelog            → (Changelog)
                       → -
## Unreleased          → (ReleaseEntry::Unreleased)
                       → (ReleaseContents)
## [x.y.z] yyyy-mm-dd  → (ReleaseEntry::Versioned)
                       → (ReleaseContents)
### Changed            → (ChangeGroup)
                       → (List)
- foo                  → (List Item)
- bar                  → (List Item)
                       → -
### Removed            → (ChangeGroup)
                       → (List)
- baz                  → (List Item)

And convert that into the following structure:

Changelog {
  unreleased: None,
  releases: [
    ReleaseEntry {
      version: x.y.z,
      date: yyyy-mm-dd,
      tag: None,
      contents: ReleaseContents {
        "Changed": ["foo", "bar"],
        "Removed": ["baz"]
      }
    }
  ]
}

@joshwlewis
Copy link
Member

This is very cool. I'd love to use it on github.com/heroku/buildpacks-nodejs when generating changelog entries for automatic inventory updates!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants