Search in sources :

Example 41 with ConfigBuilder

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

the class TestCFBugs_QueryParams method setUp.

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

Example 42 with ConfigBuilder

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

the class TestCFBugs_VarScoper method setUp.

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

Example 43 with ConfigBuilder

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

the class TestCFBugs_VarScoper_TagAttr method setUp.

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

Example 44 with ConfigBuilder

use of com.cflint.config.ConfigBuilder 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)

Example 45 with ConfigBuilder

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

the class TestCFExecuteChecker method setUp.

@Before
public void setUp() throws Exception {
    final ConfigBuilder configBuilder = new ConfigBuilder().include("AVOID_USING_CFEXECUTE_TAG");
    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