New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add modified_lines predicate #71
Conversation
Allows enabling rules based on the number of lines added or deleted by a pull request. Each property takes simple expression representing a comparison and the predicate is satisfied if any expression is matched.
modified_lines: | ||
additions: "> 100" | ||
deletion: "> 100" | ||
total: "> 200" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are all combinations of these 3 allowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the code allows all combinations of the three, as there's a clear way to evaluate all of them and combine the result. That said, I'm not sure if there are any practical policies that would make use of all three in all combinations.
return false, "", err | ||
} | ||
if ok { | ||
return true, "", nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably worth calling out in the README that the options are combined using logical or
(and not all must be true).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current comment says ... matches any of the listed conditions
- do you think it needs to be more obvious?
Co-Authored-By: bluekeyes <bluekeyes@gmail.com>
Co-Authored-By: bluekeyes <bluekeyes@gmail.com>
Allows enabling rules based on the number of lines added or deleted by a
pull request. Each property takes simple expression representing a
comparison and the predicate is satisfied if any expression is matched.
Fixes #70.