Skip to content

Commit

Permalink
#185 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaneberly committed Oct 20, 2016
1 parent 6baa954 commit 920d663
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/cflint/CFLint.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private void process(final Element elem, final String space, final Context conte
context.getMessages().clear();
} catch (final Exception e) {
if (verbose) {
e.printStackTrace();
;
}
reportRule(elem, null, context, plugin, PLUGIN_ERROR + exceptionText(e));
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/cflint.definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,13 @@
"message": [
{
"code": "FUNCTION_TYPE_MISSING",
"severity": "WARNING"
"severity": "WARNING",
"messageText": "Function ${variable} return type is missing a return type."
},
{
"code": "FUNCTION_TYPE_ANY",
"severity": "INFO"
"severity": "INFO",
"messageText": "Function ${variable} return type is any. Please change to be the correct type."
}
],
"parameter": [
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/cflint/TestCFBugs_FunctionType.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TestCFBugs_FunctionType {
public void setUp() {
final ConfigRuntime conf = new ConfigRuntime();
final PluginInfoRule pluginRule = new PluginInfoRule();
pluginRule.setName("ArgTypeChecker");
pluginRule.setName("FunctionTypeChecker");
conf.getRules().add(pluginRule);
final PluginMessage pluginMessageMissing = new PluginMessage("FUNCTION_TYPE_MISSING");
pluginMessageMissing.setSeverity("WARNING");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ {
"severity" : "WARNING",
"severity" : "INFO",
"id" : "FUNCTION_TYPE_ANY",
"message" : "FUNCTION_TYPE_ANY",
"category" : "CFLINT",
Expand All @@ -8,10 +8,10 @@
"file" : "src\\test\\resources\\com\\cflint\\tests\\FunctionType\\Any\\functionany1.cfc",
"fileName" : "functionany1.cfc",
"function" : "x",
"column" : "0",
"column" : "11",
"line" : "3",
"message" : "Function x return type is any. Please change to be the correct type.",
"variable" : "",
"expression" : ""
"variable" : "x",
"expression" : "public any function x() {\nx = 123;\n\n }"
} ]
} ]

0 comments on commit 920d663

Please sign in to comment.