- enhance handling for exhaustive matching
- exhaustive will apply on rules and labels alike - simplify code - introduce new testcases to check the new behavior
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ import {PullRequestInfo, retrieveProperty} from './pullRequests'
|
||||
/**
|
||||
* Checks if any of the rules match the given PR
|
||||
*/
|
||||
export function matchesRules(rules: Rule[], pr: PullRequestInfo, exhaustive: Boolean): Boolean {
|
||||
export function matchesRules(rules: Rule[], pr: PullRequestInfo, exhaustive: Boolean): boolean {
|
||||
const transformers: RegexTransformer[] = rules.map(rule => validateTransformer(rule)).filter(t => t !== null) as RegexTransformer[]
|
||||
if (exhaustive) {
|
||||
return transformers.every(transformer => {
|
||||
|
||||
Reference in New Issue
Block a user