Update pull_request_template.md (#4038)

This PR updates the PR template. Just simplifies stuff, fixes spacing
and casing.

### Change Type

- [ ] `feature` — New feature
- [ ] `improvement` — Product improvement
- [ ] `api` — API change
- [ ] `bugfix` — Bug fix
- [x] `other` — Changes that don't affect SDK users, e.g. internal or
.com changes
This commit is contained in:
Steve Ruiz 2024-06-28 16:57:38 +01:00 committed by GitHub
parent 978de17a12
commit bc7f0c638e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 31 deletions

View file

@ -1,25 +1,21 @@
Describe what your pull request does. If appropriate, add GIFs or images showing the before and after.
Describe what your pull request does. If you can, add GIFs or images showing the before and after of your change.
### Change Type
### Change type
- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`
<!-- ❗ Please select a 'Type' label ❗️ -->
### Test plan
- [ ] `feature` — New feature
- [ ] `improvement` — Product improvement
- [ ] `api` — API change
- [ ] `bugfix` — Bug fix
- [ ] `other` — Changes that don't affect SDK users, e.g. internal or .com changes
### Test Plan
1. Add a step-by-step description of how to test your PR here.
1. Create a shape...
2.
- [ ] Unit Tests
- [ ] Unit tests
- [ ] End to end tests
### Release Notes
### Release notes
- Add a brief release note for your PR here.
- Fixed a bug with...

View file

@ -11,22 +11,22 @@ interface Label {
}
const TYPE_LABELS = [
{
name: `feature`,
description: `New feature`,
changelogTitle: '🎉 New Features',
},
{ name: `bugfix`, description: `Bug fix`, changelogTitle: '🐛 Bug Fixes' },
{
name: `improvement`,
description: `Product improvement`,
changelogTitle: '💄 Product Improvements',
},
{
name: `feature`,
description: `New feature`,
changelogTitle: '🎉 New Features',
},
{
name: `api`,
description: `API change`,
changelogTitle: '🛠️ API Changes',
},
{ name: `bugfix`, description: `Bug fix`, changelogTitle: '🐛 Bug Fixes' },
{
name: `other`,
description: `Changes that don't affect SDK users, e.g. internal or .com changes`,
@ -39,15 +39,11 @@ export function getLabelNames() {
}
function formatTemplateOption(label: Label) {
return `- [ ] \`${label.name}\`${label.description}`
return `- [ ] \`${label.name}\``
}
export function formatLabelOptionsForPRTemplate() {
let result = `\n<!-- ❗ Please select a 'Type' label ❗️ -->\n\n`
for (const label of TYPE_LABELS) {
result += formatTemplateOption(label) + '\n'
}
return result
return TYPE_LABELS.map(formatTemplateOption).join('\n')
}
export async function generateAutoRcFile() {

View file

@ -15,16 +15,16 @@ async function updatePRTemplate(check: boolean) {
}
const prTemplate = readFileSync(prTemplatePath).toString()
const labelsPart = prTemplate.match(/(### Change Type(.|\s)*?\n)###/)?.[1]
const labelsPart = prTemplate.match(/(### Change type(.|\s)*?\n)###/)?.[1]
if (!labelsPart) {
console.error(
'❌ Could not find the labels section of the pull request template! It should start with "### Change Type"'
'❌ Could not find the labels section of the pull request template! It should start with "### Change type"'
)
process.exit(1)
}
const updated = prTemplate.replace(
labelsPart,
`### Change Type\n\n${formatLabelOptionsForPRTemplate()}\n\n`
`### Change type\n\n${formatLabelOptionsForPRTemplate()}\n\n`
)
if (check && updated !== prTemplate) {
console.error(