policy-bot
policy-bot copied to clipboard
Adding new features built-in predicates (changed_files_count, commit_count, commit_messages)
Sample policy snippet Drop something like this into your policy YAML (for example under a rule’s requires → predicates):
predicates:
changed_files_count:
total: "< 20"
added: "<= 5"
files:
include:
- "^src/.*"
exclude:
- "^docs/.*"
commit_count:
total: "<= 10"
commit_messages:
mode: all
scope: subject
matches:
- "^JIRA-[0-9]+:"
not_matches:
- "(WIP|fixup)"
Shall I work in this too
PRs for new predicates are generally welcome and these seem like reasonable things to add. Can you share an example of a policy you are trying to implement where these would help?
If you'd like to work on this, please submit a separate PR for each new predicate to make it easier to review and discuss.
@bluekeyes I have created the pr plz check this added testing test cases and attached test ss.
I need this feature for my product