When setting invalid regex for the patterns in commitConfig, pushes either fail (in the case of commitConfig.author.email.local.block) or give a misleading error (in the case of commitConfig.message.block.patterns.
Invalid author config:
"author": {
"email": {
"local": {
"block": "[invalid"
},
"domain": {
"allow": "(?<invalid"
}
}
},
Output:
Invalid message config:
"message": {
"block": {
"literals": ["safe"],
"patterns": [
"[unclosed",
"(?<incomplete",
"*invalid",
"(?P<invalid>",
"\\k<notdefined>"
]
}
},
Output:
Invalid diff config:
"diff": {
"block": {
"literals": [],
"patterns": [
"[unclosed",
"(?<incomplete"
],
"providers": {
"Bad Provider": "*starts-with-quantifier",
"Unclosed Group": "(forgot to close"
}
}
}
Output:
Describe the solution you'd like
These are likely fixed by improving the error handling in the checkCommitMessages.ts, checkAuthorEmails.ts and scanDiff.ts processors. We should make sure each action gives a descriptive error on invalid regex but blocks the push instead of crashing.
Additional context
Found when writing documentation for the chain in #1335
When setting invalid regex for the patterns in
commitConfig, pushes either fail (in the case ofcommitConfig.author.email.local.block) or give a misleading error (in the case ofcommitConfig.message.block.patterns.Invalid
authorconfig:Output:
Invalid
messageconfig:Output:
Invalid
diffconfig:Output:
Describe the solution you'd like
These are likely fixed by improving the error handling in the
checkCommitMessages.ts,checkAuthorEmails.tsandscanDiff.tsprocessors. We should make sure each action gives a descriptive error on invalid regex but blocks the push instead of crashing.Additional context
Found when writing documentation for the chain in #1335