Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaneberly committed Mar 31, 2017
1 parent eb10fda commit 25aed3b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/cflint/main/CFLintMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,15 @@ private void ui() {
private static CFLintConfig loadConfig(final String configfile) {
if (configfile != null) {
try {
CFLintPluginInfo pluginInfo=null;
if (configfile.toLowerCase().endsWith(".xml")) {
return ConfigUtils.unmarshal(new FileInputStream(configfile), CFLintConfig.class);
pluginInfo= ConfigUtils.unmarshal(new FileInputStream(configfile), CFLintPluginInfo.class);
} else {
return ConfigUtils.unmarshalJson(new FileInputStream(configfile), CFLintConfig.class);
pluginInfo= ConfigUtils.unmarshalJson(new FileInputStream(configfile), CFLintPluginInfo.class);
}
CFLintConfig returnVal = new CFLintConfig();
returnVal.setRules(pluginInfo.getRules());
return returnVal;
} catch (final Exception e) {
System.err.println("Unable to load config file. " + e.getMessage());
}
Expand Down

0 comments on commit 25aed3b

Please sign in to comment.