Search in sources :

Example 1 with CFTagCaseChecker

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

the class TestCFTagLowercaseChecker method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    PluginInfoRule pluginRule = new PluginInfoRule();
    pluginRule.setName("CFTagCaseChecker");
    conf.getRules().add(pluginRule);
    PluginMessage pluginMessage = new PluginMessage("CFTAG_PREFERRED_CASE");
    pluginMessage.setSeverity("ERROR");
    pluginMessage.setMessageText("Tag <${variable}> should be written in lowercase or camelCase for consistency in code.");
    pluginRule.getMessages().add(pluginMessage);
    CFTagCaseChecker caseChecker = new CFTagCaseChecker();
    caseChecker.setParameter("PreferCase", "lower");
    cfBugs = new CFLint(conf, caseChecker);
    cfBugs.setLogError(false);
}
Also used : CFTagCaseChecker(com.cflint.plugins.core.CFTagCaseChecker) 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 CFTagCaseChecker

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

the class TestCFTagUppercaseChecker method setUp.

@Before
public void setUp() throws Exception {
    final CFLintConfig conf = new CFLintConfig();
    PluginInfoRule pluginRule = new PluginInfoRule();
    pluginRule.setName("CFTagCaseChecker");
    conf.getRules().add(pluginRule);
    PluginMessage pluginMessage = new PluginMessage("CFTAG_PREFERRED_CASE");
    pluginMessage.setSeverity("ERROR");
    pluginMessage.setMessageText("Tag <${variable}> should be written in lowercase or camelCase for consistency in code.");
    pluginRule.getMessages().add(pluginMessage);
    CFTagCaseChecker caseChecker = new CFTagCaseChecker();
    caseChecker.setParameter("PreferCase", "upper");
    cfBugs = new CFLint(conf, caseChecker);
    cfBugs.setLogError(false);
}
Also used : CFTagCaseChecker(com.cflint.plugins.core.CFTagCaseChecker) 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)2 PluginInfoRule (com.cflint.config.CFLintPluginInfo.PluginInfoRule)2 PluginMessage (com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage)2 CFTagCaseChecker (com.cflint.plugins.core.CFTagCaseChecker)2 Before (org.junit.Before)2