Search in sources :

Example 46 with ConfigBuilder

use of com.cflint.config.ConfigBuilder 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(Levels.ERROR);
    pluginMessage.setMessageText("Tag <${variable}> should be written in lowercase or camelCase for consistency in code.");
    pluginRule.getMessages().add(pluginMessage);
    CFLintPluginInfo pluginInfo = new CFLintPluginInfo();
    pluginInfo.getRules().add(pluginRule);
    pluginRule.setClassName("CFTagCaseChecker");
    pluginRule.addParameter("PreferCase", "lower");
    cfBugs = new CFLintAPI(new ConfigBuilder(pluginInfo).include("CFTAG_PREFERRED_CASE").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)

Example 47 with ConfigBuilder

use of com.cflint.config.ConfigBuilder 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(Levels.ERROR);
    pluginMessage.setMessageText("Tag <${variable}> should be written in lowercase or camelCase for consistency in code.");
    pluginRule.getMessages().add(pluginMessage);
    CFLintPluginInfo pluginInfo = new CFLintPluginInfo();
    pluginInfo.getRules().add(pluginRule);
    pluginRule.setClassName("CFTagCaseChecker");
    pluginRule.addParameter("PreferCase", "upper");
    cfBugs = new CFLintAPI(new ConfigBuilder(pluginInfo).include("CFTAG_PREFERRED_CASE").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)

Example 48 with ConfigBuilder

use of com.cflint.config.ConfigBuilder in project CFLint by cflint.

the class TestCFUpdateTagChecker method setUp.

@Before
public void setUp() throws Exception {
    final ConfigBuilder configBuilder = new ConfigBuilder().include("AVOID_USING_CFUPDATE_TAG");
    cfBugs = new CFLintAPI(configBuilder.build());
}
Also used : CFLintAPI(com.cflint.api.CFLintAPI) ConfigBuilder(com.cflint.config.ConfigBuilder) Before(org.junit.Before)

Example 49 with ConfigBuilder

use of com.cflint.config.ConfigBuilder in project CFLint by cflint.

the class TestCreateObjectChecker method setUp.

@Before
public void setUp() throws Exception {
    final ConfigBuilder configBuilder = new ConfigBuilder().include("AVOID_USING_CREATEOBJECT");
    cfBugs = new CFLintAPI(configBuilder.build());
}
Also used : CFLintAPI(com.cflint.api.CFLintAPI) ConfigBuilder(com.cflint.config.ConfigBuilder) Before(org.junit.Before)

Example 50 with ConfigBuilder

use of com.cflint.config.ConfigBuilder in project CFLint by cflint.

the class TestDebugChecker method setUp.

@Before
public void setUp() throws Exception {
    final ConfigBuilder configBuilder = new ConfigBuilder().include("AVOID_USING_ISDEBUGMODE");
    cfBugs = new CFLintAPI(configBuilder.build());
}
Also used : CFLintAPI(com.cflint.api.CFLintAPI) ConfigBuilder(com.cflint.config.ConfigBuilder) Before(org.junit.Before)

Aggregations

ConfigBuilder (com.cflint.config.ConfigBuilder)54 CFLintAPI (com.cflint.api.CFLintAPI)53 Before (org.junit.Before)53 CFLintPluginInfo (com.cflint.config.CFLintPluginInfo)4 PluginInfoRule (com.cflint.config.CFLintPluginInfo.PluginInfoRule)4 PluginMessage (com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage)4 CFLintConfig (com.cflint.config.CFLintConfig)3 CFLintConfigurationException (com.cflint.exception.CFLintConfigurationException)1 CFLintScanException (com.cflint.exception.CFLintScanException)1 MarshallerException (com.cflint.xml.MarshallerException)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 JAXBException (javax.xml.bind.JAXBException)1 TransformerException (javax.xml.transform.TransformerException)1