-
Notifications
You must be signed in to change notification settings - Fork 61
Ignore "pull request tasks check" for specified checkboxes #591
Description
Background
Hi, I've started using Zappr recently. I use it for commit check, spec check and approval check. I really like the idea of having the approval policy explicitly defined as a code. It reduces ambiguity, plus compared to having the policy in docs this doesn't run the risk of containing outdated info, so thanks for developing it!
I also wanted to use the "Pull request tasks check" feature. However, in the PR template I use, there are both checkboxes that should all be checked (checklist), but also checkboxes where the contributor should check only one of the boxes (e.g. "Does the PR contain breaking changes? Yes [] / No []").
Question
I wonder whether there have been any thoughts about providing a way to exclude certain checkboxes?
Suggestions
My first thought was similar to how TS (// @ts-ignore) or ESLint (// eslint-disable-line) ignore rules.
Then I checked the code where the tasks check is defined and saw that the regex for detecting unchecked boxes is hardcoded there. So a simpler and more powerful option would be to let user change that regex.
That way, I could modify the regex to look only for checkboxes which are/aren't in particular sections.
However, this would require creating a section in the zappr.yml so it could be configured.
It could look for example like this:
# .zappr.yml
... # other options
tasks:
pattern: *your regex as string here* # default: '(-|\\*) \\[(\\s|x)\\]', same as it is now