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

Improve commit messages #391

Closed
1 task done
ErikBjare opened this issue Mar 24, 2020 · 6 comments · Fixed by #415
Closed
1 task done

Improve commit messages #391

ErikBjare opened this issue Mar 24, 2020 · 6 comments · Fixed by #415

Comments

@ErikBjare
Copy link
Member

ErikBjare commented Mar 24, 2020

Since we've started auto-generating changelogs I started looking into how other projects do it and many do so by enforcing a standard format for commit messages.

One prominent standard is Conventional Commits. A few examples:

fix: fixed bug #X
docs: updated README
ci: added platform to CI

Types I propose we use are: fix, feat, build, chore, ci, docs, style, refactor, perf, test

It's important that we strike a good balance. We don't want to discourage new contributors by being nitpicky. Worst case we can always clean up the changelog manually, but having at least most commit follow the convention would make things easier.

  • Update CONTRIBUTING.md with guidelines

Related to #377

Thoughts @johan-bjareholt, @xylix?

@xylix
Copy link
Contributor

xylix commented Mar 24, 2020

I'm unsure about some of the proposed types though. Most style and perf changes could go under fix/feat/refactor so they overlap quite a bit.

Otherwise looks good to me.

@ErikBjare
Copy link
Member Author

I took the types from https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type

  • perf: A code change that improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)

@johan-bjareholt
Copy link
Member

johan-bjareholt commented Mar 25, 2020

Such a rule sounds a bit too strict in my opinion.
I love clear commit messages, but as long as each commit title is descriptive and it's clear what part of the code it impacts I think this is an non-issue.
We should instead just have a guideline of making clear commit messages and tell people to squash their commits if some of them are a fix/typo/refactoring in code which is not even merged yet, that's what I find our current issues with our commit messages are.

@ErikBjare
Copy link
Member Author

As I said, I'm not enforcing any strictness, just a guideline. Prefixing commits with a type helps loads with autogenerating the changelog, and going through the commit history in general.

...and tell people to squash their commits if some of them are a fix/typo/refactoring in code which is not even merged yet, that's what I find our current issues with our commit messages are.

Agreed, I've been better at doing this myself recently, which is partly what led me to also want this.

@xylix
Copy link
Contributor

xylix commented Mar 25, 2020

Hm yeah being able to drop most refactor, ci and chore commits from the changelog automatically would make generating changelogs much nicer, so I agree with adding this to the guidelines and will try to follow it in the future.

@ErikBjare
Copy link
Member Author

ErikBjare commented Apr 19, 2020

@xylix Added grouping of changelog entries by type as a subtask in #377.

Submitted a PR for the CONTRIBUTING.md changes in #415

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 a pull request may close this issue.

3 participants