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

Add workflow for linting CHANGELOG.md #766

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

Conversation

marians
Copy link
Member

@marians marians commented Jan 9, 2024

Towards https://github.com/giantswarm/giantswarm/issues/29422

This PR adds a workflow to be added to all flavours of GitHub project repos. The workflow is called lint-changelog and checks the CHANGELOG.md file if it has been verified in the context of a pull requests.

The workflow is intended to be used as an optional (not required) check for pull requests, since some PRs, e. g. those made by Renovate, won't get changelog updates.

What is checked?

  • Check if the changelog is empty
  • Check if the changelog can be parsed using parse-changelog
  • Check if there are unreleased changes mentioned, as should normally be the case for a pull request

Checklist

  • Update changelog in CHANGELOG.md.

@marians marians self-assigned this Jan 9, 2024
@marians marians changed the title Add workflow stub Add workflow for linting CHANGELOG.md Jan 9, 2024
if [ -z "$CHANGES" ]
then
echo "::warning file=CHANGELOG.md,line=1,col=1,endColumn=1::Please don't forget to add info about your changes to CHANGELOG.md"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we check for trailing whitespace, maybe? People sometimes introduce those, and they get trimmed away by reasonably-configured editors and that can be conflicting/annoying on rebase. I'd like to avoid that overall, even if it sounds minor.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically we want strict Markdown linting on changelogs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown allows extra whitespace, and even gives it special meaning (google "markdown two spaces"), but trailing whitespace should be avoided everywhere since some people configure their editors to trim them correctly (and everyone should). So it's not about Markdown linting, but I'd be in favor of running markdownlint against CHANGELOG.md if the findings are shown in GitHub PRs.

@AndiDog AndiDog self-assigned this Apr 25, 2024
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