pr-compliance-action
pr-compliance-action copied to clipboard
feat: body-invalid-check
What type of PR is this? (check all applicable)
- [ ] ♻️ Refactor
- [x] ✨ Feature
- [ ] 🐛 Bug Fix
- [ ] 👷 Optimization
- [ ] 📝 Documentation Update
- [ ] 🔖 Release
- [ ] 🚩 Other
Description
This change adds a compliance check to look for invalid content in the PR description, such as placeholders from PR templates that are meant to have been replaced.
Related Tickets & Documents
This PR resolves #199
Mobile & Desktop Screenshots/Recordings
Added tests?
- [ ] 👍 yes
- [x] 🙅 no, because they aren't needed
- [ ] 🙋 no, because I need help
Added to documentation?
- [x] 📜 readme
- [ ] 🙅 no documentation needed
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?
cc @bdougie @0-vortex
The idea of checking a regex is great, not sure how this would affect templates or how it looks like :D
The idea of checking a regex is great, not sure how this would affect templates or how it looks like :D
Yeah, I haven't tested this out yet. My thought would be to make a regex that would match the block of empty checkboxes perhaps, and blocks like this: "[adds/removes/fixes/replaces]", such as that found in: https://github.com/open-sauced/.github/blob/main/.github/PULL_REQUEST_TEMPLATE.md
Tried this out with some regexes this evening. Doesn't work the way I thought, so needs some work.
👋 @mtfoley these changes look very useful and I'm interested in seeing them merged. Is there anything I can help with?
Hey @JoshuaKGoldberg, TL;DR = help would be appreciated, in whatever form you find suits you 👍
I totally agree on the usefulness. I think I got hung up on regular expression handling (e.g. which flags to assume, etc). In this branch ("placeholder-check"), the logic is mostly there, but I haven't taken the time to come up with a sensible way to apply one or more regexes to what is presumably a multiline input. To step out to a bigger picture of the use case, imagine if you have PR templates with placeholder text that you want the author to modify - how do you make sure they did it right? What if is a series of checkboxes, one of which must be checked?