Sometimes you want to flag cases where a file is missing a certain pattern.
For example, a config file for a tool that sends alerts may need to specify the email address that notifications should go to. If the developer forgets to fill that field in the tool will do nothing; If they really want it to do nothing they should remove it. Sample file:
toolConfigBlah: do stuff this way
# notificationTarget: <todo: provide an email address here and uncomment this line before the first release of this software>
Rule would say: If "(?m)^notificationTarget: [regexEmailPattern]" doesn't exist in files named "theTool.config" raise an issue.
Note that the "Required String not Present" rule type allows you to do this already BUT it requires you to define a trigger string that must be present before an issue can be raised.
Sometimes you want to flag cases where a file is missing a certain pattern.
For example, a config file for a tool that sends alerts may need to specify the email address that notifications should go to. If the developer forgets to fill that field in the tool will do nothing; If they really want it to do nothing they should remove it. Sample file:
Rule would say: If "(?m)^notificationTarget: [regexEmailPattern]" doesn't exist in files named "theTool.config" raise an issue.
Note that the "Required String not Present" rule type allows you to do this already BUT it requires you to define a trigger string that must be present before an issue can be raised.