- To have consistent PR titles
- To have consistent commit messages on master
If we squash the PR when we merge it, the PR title becomes the commit message on master. As a result, we just need to enforce consistency on the title of the PR to have consistent commit message on master.
The commits of the PR won't be on master, but are still useful for PR readliness and for future reference.
- The agreed upon format for the PR title is:
<jira> <type>(<scope>): <short summary>
│ │ | │
│ │ | └─⫸ PR Summary: short summary of the Jira ticket title in English. Present tense.
│ │ | Not capitalized. No period at the end.
│ │ |
│ │ └─⫸ PR Scope: Hierarchical scope. Not capitalized, but snakeCase. For instance:
│ │ app, core, themeProvider... > identityCheck, eac, booking, search... > useSelectPlaylist...
│ │
│ └─⫸ PR Type: build, ci, docs, feat, fix, perf, refactor or test.
| See https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type
│
└─⫸ Jira ticket number: with parentheses -> (PC-1234).
Available types: build
, ci
, docs
, feat
, fix
, perf
, refactor
and test
.
- Github action to ensure that the PR title is in the right format: pr-title-checker.yml
- Test of the regex used in the github action: pr-title-checker.test.ts
See ADR