Search in sources :

Example 1 with CFXTagChecker

use of com.cflint.plugins.core.CFXTagChecker in project CFLint by cflint.

the class TestCFInsertTagChecker method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    final PluginInfoRule pluginRuleX = new PluginInfoRule();
    pluginRuleX.setName("CFXTagChecker");
    pluginRuleX.addParameter("tagName", "cfinsert");
    conf.getRules().add(pluginRuleX);
    final PluginMessage pluginMessageX = new PluginMessage("AVOID_USING_CFINSERT_TAG");
    pluginMessageX.setSeverity("WARNING");
    pluginMessageX.setMessageText("Avoid Leaving <${tagName}> tags in committed code. Debug information should be ommited from release code");
    pluginRuleX.getMessages().add(pluginMessageX);
    final CFXTagChecker checker = new CFXTagChecker();
    checker.setParameter("tagName", "cfinsert");
    cfBugs = new CFLint(conf, checker);
}
Also used : CFXTagChecker(com.cflint.plugins.core.CFXTagChecker) CFLintConfig(com.cflint.config.CFLintConfig) PluginMessage(com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage) PluginInfoRule(com.cflint.config.CFLintPluginInfo.PluginInfoRule) Before(org.junit.Before)

Example 2 with CFXTagChecker

use of com.cflint.plugins.core.CFXTagChecker in project CFLint by cflint.

the class TestCFModuleTagChecker method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    final PluginInfoRule pluginRuleX = new PluginInfoRule();
    pluginRuleX.setName("CFXTagChecker");
    pluginRuleX.addParameter("tagName", "cfmodule");
    conf.getRules().add(pluginRuleX);
    final PluginMessage pluginMessageX = new PluginMessage("AVOID_USING_CFMODULE_TAG");
    pluginMessageX.setSeverity("WARNING");
    pluginMessageX.setMessageText("Avoid Leaving <${tagName}> tags in committed code. Debug information should be ommited from release code");
    pluginRuleX.getMessages().add(pluginMessageX);
    final CFXTagChecker checker = new CFXTagChecker();
    checker.setParameter("tagName", "cfmodule");
    cfBugs = new CFLint(conf, checker);
}
Also used : CFXTagChecker(com.cflint.plugins.core.CFXTagChecker) CFLintConfig(com.cflint.config.CFLintConfig) PluginMessage(com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage) PluginInfoRule(com.cflint.config.CFLintPluginInfo.PluginInfoRule) Before(org.junit.Before)

Example 3 with CFXTagChecker

use of com.cflint.plugins.core.CFXTagChecker in project CFLint by cflint.

the class TestCFDumpChecker method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    final PluginInfoRule pluginRuleX = new PluginInfoRule();
    pluginRuleX.setName("CFXTagChecker");
    pluginRuleX.addParameter("tagName", "cfdump");
    conf.getRules().add(pluginRuleX);
    final PluginMessage pluginMessageX = new PluginMessage("AVOID_USING_CFDUMP_TAG");
    pluginMessageX.setSeverity("WARNING");
    pluginMessageX.setMessageText("Avoid Leaving <${tagName}> tags in committed code. Debug information should be ommited from release code");
    pluginRuleX.getMessages().add(pluginMessageX);
    final CFXTagChecker checker = new CFXTagChecker();
    checker.setParameter("tagName", "cfdump");
    cfBugs = new CFLint(conf, checker);
}
Also used : CFXTagChecker(com.cflint.plugins.core.CFXTagChecker) CFLintConfig(com.cflint.config.CFLintConfig) PluginMessage(com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage) PluginInfoRule(com.cflint.config.CFLintPluginInfo.PluginInfoRule) Before(org.junit.Before)

Example 4 with CFXTagChecker

use of com.cflint.plugins.core.CFXTagChecker in project CFLint by cflint.

the class TestCFUpdateTagChecker method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    final PluginInfoRule pluginRuleX = new PluginInfoRule();
    pluginRuleX.setName("CFXTagChecker");
    pluginRuleX.addParameter("tagName", "cfupdate");
    conf.getRules().add(pluginRuleX);
    final PluginMessage pluginMessageX = new PluginMessage("AVOID_USING_CFUPDATE_TAG");
    pluginMessageX.setSeverity("WARNING");
    pluginMessageX.setMessageText("Avoid Leaving <${tagName}> tags in committed code. Debug information should be ommited from release code");
    pluginRuleX.getMessages().add(pluginMessageX);
    final CFXTagChecker checker = new CFXTagChecker();
    checker.setParameter("tagName", "cfupdate");
    cfBugs = new CFLint(conf, checker);
}
Also used : CFXTagChecker(com.cflint.plugins.core.CFXTagChecker) CFLintConfig(com.cflint.config.CFLintConfig) PluginMessage(com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage) PluginInfoRule(com.cflint.config.CFLintPluginInfo.PluginInfoRule) Before(org.junit.Before)

Example 5 with CFXTagChecker

use of com.cflint.plugins.core.CFXTagChecker 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");
    pluginRuleX.addParameter("tagName", "cfcustomtag");
    conf.getRules().add(pluginRuleX);
    final PluginMessage pluginMessageX = new PluginMessage("AVOID_USING_MYLIB:CFCUSTOMTAG_TAG");
    pluginMessageX.setSeverity("WARNING");
    pluginMessageX.setMessageText("Avoid Leaving <${tagName}> tags in committed code. Debug information should be ommited from release code");
    pluginRuleX.getMessages().add(pluginMessageX);
    final CFXTagChecker checker = new CFXTagChecker();
    checker.setParameter("tagName", ".*:cfcustomtag");
    cfBugs = new CFLint(conf, checker);
}
Also used : CFXTagChecker(com.cflint.plugins.core.CFXTagChecker) CFLintConfig(com.cflint.config.CFLintConfig) PluginMessage(com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage) PluginInfoRule(com.cflint.config.CFLintPluginInfo.PluginInfoRule) Before(org.junit.Before)

Aggregations

CFLintConfig (com.cflint.config.CFLintConfig)6 PluginInfoRule (com.cflint.config.CFLintPluginInfo.PluginInfoRule)6 PluginMessage (com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage)6 CFXTagChecker (com.cflint.plugins.core.CFXTagChecker)6 Before (org.junit.Before)6