diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 0000000..511754c --- /dev/null +++ b/Dangerfile @@ -0,0 +1,63 @@ +def validate_template(pr_body) + + failure("You did not complete the `Type of change(s)` checklist") if !meets_types_lines(pr_body) + failure("You did not complete the `Before you begin` checklist") if !meets_required_lines(pr_body) + +end + +def meets_required_lines(pr_body) + lines = Array.new + + pr_body.each_line do |line| + if line.include?(" -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] Hotfix / Breakfix (fix or feature that would cause existing functionality to change) -- [ ] Refactoring (changes in code organization without major change in functionality) -- [ ] Documentation addition / update (changes in stored documentation that does not affect functionality) -- [ ] CI/CD change (changes to any versioned CI related configuration / tools) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] Hotfix / Breakfix (fix or feature that would cause existing functionality to change) +- [ ] Refactoring (changes in code organization without major change in functionality) +- [ ] Documentation addition / update (changes in stored documentation that does not affect functionality) +- [ ] CI/CD change (changes to any versioned CI related configuration / tools) ## Before You Begin - -- [ ] Builds clean without any errors? -- [ ] Jira ticket URL has been added to the title above (e.g. CNBCMAPP-420) -- [ ] I have added / updated tests to cover my changes. -- [ ] Have all new and existing tests passed? -- [ ] I have updated the documentation accordingly. -- [ ] Has this been signed off by Product or Design? +- [ ] Builds clean without any errors? +- [ ] Jira ticket URL has been added to the title above (e.g. CNBCMAPP-420) +- [ ] I have added / updated tests to cover my changes. +- [ ] Have all new and existing tests passed? +- [ ] I have updated the documentation accordingly. +- [ ] Has this been signed off by Product or Design? ##### If any of the above are not checked please explain why: -## Description of Your Changes +## Description of Your Changes ## How Has This Been Tested? - Provide the steps to test this -## Device / Form Factor Checklist +## Device / Form Factor Checklist This PR has been tested with the following devices: - +- [ ] Not Applicable - [ ] iPhone - [ ] Large (Plus, Max) - [ ] X (X, Xr, Xs) @@ -56,14 +53,11 @@ This PR has been tested with the following devices: ## Screenshots (if appropriate): ## Dependencies - Provide details on other PRs that are dependent on this / this PR is dependent on: ## Documentation - If you created / updated documentation, necessary documentation & links (if applicable): ## Notes - - + \ No newline at end of file