From 25aed3ba00128f5595362e9792ab690796f258ea Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 30 Mar 2017 22:20:19 -0400 Subject: [PATCH] #260 --- src/main/java/com/cflint/main/CFLintMain.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cflint/main/CFLintMain.java b/src/main/java/com/cflint/main/CFLintMain.java index d9dacb22a..479f2dc8e 100644 --- a/src/main/java/com/cflint/main/CFLintMain.java +++ b/src/main/java/com/cflint/main/CFLintMain.java @@ -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()); }