Presubmit.Assertions.Changelog (presubmit v0.2.2)

Copy Markdown View Source

Assertions over CHANGELOG.md, built on Presubmit.Changelog.

Summary

Functions

Asserts that when the commit changes the public API, the changelog's unreleased section gains content.

Asserts that when the commit bumps the version in mix.exs, the changelog has a section for the new version. A commit that creates mix.exs starts a project rather than releasing one, so it has nothing to log.

Functions

assert_api_changes_logged(commit, path \\ "CHANGELOG.md")

@spec assert_api_changes_logged(Presubmit.Commit.t(), String.t()) :: :ok

Asserts that when the commit changes the public API, the changelog's unreleased section gains content.

The public API is what Presubmit.Query.public_api_diff/1 reports: API functions in the files the project ships. Test support and fixtures that only MIX_ENV=test compiles are not part of it.

assert_release_logged(commit, path \\ "CHANGELOG.md")

@spec assert_release_logged(Presubmit.Commit.t(), String.t()) :: :ok

Asserts that when the commit bumps the version in mix.exs, the changelog has a section for the new version. A commit that creates mix.exs starts a project rather than releasing one, so it has nothing to log.