pr-compliance-action icon indicating copy to clipboard operation
pr-compliance-action copied to clipboard

feat: body-invalid-check

Open mtfoley opened this issue 2 years ago • 5 comments

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?

tick the boxes

cc @bdougie @0-vortex

mtfoley avatar May 27 '22 03:05 mtfoley

The idea of checking a regex is great, not sure how this would affect templates or how it looks like :D

0-vortex avatar May 27 '22 15:05 0-vortex

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

mtfoley avatar May 27 '22 17:05 mtfoley

Tried this out with some regexes this evening. Doesn't work the way I thought, so needs some work.

mtfoley avatar Jun 24 '22 03:06 mtfoley

👋 @mtfoley these changes look very useful and I'm interested in seeing them merged. Is there anything I can help with?

JoshuaKGoldberg avatar Dec 14 '22 16:12 JoshuaKGoldberg

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?

mtfoley avatar Dec 15 '22 02:12 mtfoley