- 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 readiness 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... > useSelectHomepageEntry...
│ │
│ └─⫸ 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: dev_on_pull_request_title_checker.yml
- Test of the regex used in the GitHub action: pr-title-checker.test.ts
See ADR