diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e30db4dd9..1ca7ca42c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,15 +1,29 @@ ## Description of the change + > Description goes here + ## Type of change + - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) + ## Related issues + > Issue links go here + +## Usage Example + +> Example of how to call it + ## Checklists + ### Development + - [ ] Lint rules pass locally - [ ] The code changed/added as part of this pull request has been covered with tests -### Code review + +### Code review + - [ ] This pull request has a descriptive title and information useful to a reviewer -- [ ] Issue from task tracker has a link to this pull request +- [ ] Issue from task tracker has a link to this pull request diff --git a/dangerfile.ts b/dangerfile.ts index 670ae0b05..ef5f9eac7 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -4,6 +4,8 @@ import collectCoverage, { ReportType } from '@instabug/danger-plugin-coverage'; const hasSourceChanges = danger.git.modified_files.some((file) => file.startsWith('lib/') ); +const hasModulesChanges = danger.git.modified_files.some((file) => file.startsWith('lib/src/modules/')); + const declaredTrivial = !hasSourceChanges || danger.github.issue.labels.some((label) => label.name === 'trivial'); @@ -14,12 +16,16 @@ async function hasDescription() { const hasNoDescription = danger.github.pr.body.includes( '> Description goes here' ); + const hasNoExample = danger.github.pr.body.includes('> Example of how to call it'); + if (hasNoDescription && linesOfCode > 10) { fail( 'Please provide a summary of the changes in the pull request description.' ); } - + if (hasNoExample && linesOfCode > 10 && hasModulesChanges) { + warn('Please provide example of how to call it.'); + } if (!danger.git.modified_files.includes('CHANGELOG.md') && !declaredTrivial) { warn( 'You have not included a CHANGELOG entry! \nYou can find it at [CHANGELOG.md](https://github.com/Instabug/Instabug-Flutter/blob/master/CHANGELOG.md).'