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 1. Create a shape...
- [ ] `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.
2. 2.
- [ ] Unit Tests - [ ] Unit tests
- [ ] End to end 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 = [ const TYPE_LABELS = [
{ { name: `bugfix`, description: `Bug fix`, changelogTitle: '🐛 Bug Fixes' },
name: `feature`,
description: `New feature`,
changelogTitle: '🎉 New Features',
},
{ {
name: `improvement`, name: `improvement`,
description: `Product improvement`, description: `Product improvement`,
changelogTitle: '💄 Product Improvements', changelogTitle: '💄 Product Improvements',
}, },
{
name: `feature`,
description: `New feature`,
changelogTitle: '🎉 New Features',
},
{ {
name: `api`, name: `api`,
description: `API change`, description: `API change`,
changelogTitle: '🛠️ API Changes', changelogTitle: '🛠️ API Changes',
}, },
{ name: `bugfix`, description: `Bug fix`, changelogTitle: '🐛 Bug Fixes' },
{ {
name: `other`, name: `other`,
description: `Changes that don't affect SDK users, e.g. internal or .com changes`, 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) { function formatTemplateOption(label: Label) {
return `- [ ] \`${label.name}\`${label.description}` return `- [ ] \`${label.name}\``
} }
export function formatLabelOptionsForPRTemplate() { export function formatLabelOptionsForPRTemplate() {
let result = `\n<!-- ❗ Please select a 'Type' label ❗️ -->\n\n` return TYPE_LABELS.map(formatTemplateOption).join('\n')
for (const label of TYPE_LABELS) {
result += formatTemplateOption(label) + '\n'
}
return result
} }
export async function generateAutoRcFile() { export async function generateAutoRcFile() {

View file

@ -15,16 +15,16 @@ async function updatePRTemplate(check: boolean) {
} }
const prTemplate = readFileSync(prTemplatePath).toString() 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) { if (!labelsPart) {
console.error( 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) process.exit(1)
} }
const updated = prTemplate.replace( const updated = prTemplate.replace(
labelsPart, labelsPart,
`### Change Type\n\n${formatLabelOptionsForPRTemplate()}\n\n` `### Change type\n\n${formatLabelOptionsForPRTemplate()}\n\n`
) )
if (check && updated !== prTemplate) { if (check && updated !== prTemplate) {
console.error( console.error(