Skip to content

Commit

Permalink
Trying to fix addition issue in cflint#290 - PARSE_ERROR still gets e…
Browse files Browse the repository at this point in the history
…xposed and output if a directory is supposed to be ignored.
  • Loading branch information
TheRealAgentK committed Jun 30, 2017
1 parent 1dd11c6 commit b402275
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/main/java/com/cflint/CFLint.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.cflint.config.*;
import org.antlr.runtime.BitSet;
import org.antlr.v4.runtime.Parser;
import org.antlr.v4.runtime.Recognizer;
Expand All @@ -24,12 +25,8 @@
import org.antlr.v4.runtime.dfa.DFA;

import com.cflint.BugInfo.BugInfoBuilder;
import com.cflint.config.CFLintChainedConfig;
import com.cflint.config.CFLintConfig;
import com.cflint.config.CFLintConfiguration;
import com.cflint.config.CFLintPluginInfo.PluginInfoRule;
import com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage;
import com.cflint.config.ConfigUtils;
import com.cflint.listeners.ScanProgressListener;
import com.cflint.plugins.CFLintScanner;
import com.cflint.plugins.CFLintSet;
Expand Down Expand Up @@ -1021,6 +1018,12 @@ public void reportRule(final Element elem, final Object expression, final Contex
msgInfo.setMessageText("CF file is empty: ${file}");
msgInfo.setSeverity("WARNING");
ruleInfo.getMessages().add(msgInfo);
}else if ("PARSE_ERROR".equals(msgcode)) {
ruleInfo = new CFLintPluginInfo.PluginInfoRule();
final CFLintPluginInfo.PluginInfoRule.PluginMessage msgInfo = new CFLintPluginInfo.PluginInfoRule.PluginMessage("PARSE_ERROR");
msgInfo.setMessageText("Unable to parse");
msgInfo.setSeverity("ERROR");
ruleInfo.getMessages().add(msgInfo);
} else {
if (plugin == null) {
throw new NullPointerException(
Expand Down Expand Up @@ -1246,9 +1249,11 @@ public void syntaxError(final Recognizer<?, ?> recognizer, final Object offendin
final Context context = new Context(currentFile,currentElement,null,true,null,null);
final ContextMessage cm = new ContextMessage("MISSING_SEMI", expression,null,line);
reportRule(currentElement,null,context,null, cm);

} else {
fireCFLintException(e, PARSE_ERROR, file, line, charPositionInLine, "", msg);
//fireCFLintException(e, PARSE_ERROR, file, line, charPositionInLine, "", msg);
final Context context = new Context(currentFile,currentElement,null,true,null,null);
final ContextMessage cm = new ContextMessage("PARSE_ERROR", expression,null,line);
reportRule(currentElement,null,context,null, cm);
}
}

Expand Down

0 comments on commit b402275

Please sign in to comment.