Search in sources :

Example 16 with PluginMessage

use of com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage in project CFLint by cflint.

the class TestCFCustomTagChecker method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    final PluginInfoRule pluginRuleX = new PluginInfoRule();
    pluginRuleX.setName("CFXTagChecker");
    conf.getRules().add(pluginRuleX);
    final PluginMessage pluginMessageX = new PluginMessage("AVOID_USING_MYLIB:CFCUSTOMTAG_TAG");
    pluginMessageX.setSeverity(Levels.WARNING);
    pluginMessageX.setMessageText("Avoid Leaving <${tagName}> tags in committed code. Debug information should be ommited from release code");
    pluginRuleX.getMessages().add(pluginMessageX);
    pluginRuleX.addParameter("tagName", ".*:cfcustomtag");
    CFLintPluginInfo pluginInfo = new CFLintPluginInfo();
    pluginInfo.getRules().add(pluginRuleX);
    pluginRuleX.setClassName("CFXTagChecker");
    cfBugs = new CFLintAPI(new ConfigBuilder(pluginInfo).include("AVOID_USING_MYLIB:CFCUSTOMTAG_TAG").build());
    cfBugs.setLogError(false);
}
Also used : CFLintAPI(com.cflint.api.CFLintAPI) CFLintPluginInfo(com.cflint.config.CFLintPluginInfo) CFLintConfig(com.cflint.config.CFLintConfig) PluginMessage(com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage) ConfigBuilder(com.cflint.config.ConfigBuilder) PluginInfoRule(com.cflint.config.CFLintPluginInfo.PluginInfoRule) Before(org.junit.Before)

Aggregations

PluginMessage (com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage)16 PluginInfoRule (com.cflint.config.CFLintPluginInfo.PluginInfoRule)11 CFLintPluginInfo (com.cflint.config.CFLintPluginInfo)6 CFLintConfig (com.cflint.config.CFLintConfig)5 Test (org.junit.Test)5 RuleGroup (com.cflint.config.CFLintPluginInfo.RuleGroup)4 ConfigBuilder (com.cflint.config.ConfigBuilder)4 CFLintAPI (com.cflint.api.CFLintAPI)3 Before (org.junit.Before)3 PluginParameter (com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginParameter)2 FileWriter (java.io.FileWriter)2 IOException (java.io.IOException)2 LinkedHashMap (java.util.LinkedHashMap)2 TransformerException (javax.xml.transform.TransformerException)2 CFExpression (cfml.parsing.cfscript.CFExpression)1 CFStatement (cfml.parsing.cfscript.CFStatement)1 CFScriptStatement (cfml.parsing.cfscript.script.CFScriptStatement)1 BugInfoBuilder (com.cflint.BugInfo.BugInfoBuilder)1 CFLint (com.cflint.CFLint)1 HTMLOutput (com.cflint.HTMLOutput)1