Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
adireddy committed Feb 29, 2016
2 parents 3c5f5d3 + 1857a7a commit c306e92
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions checkstyle/Main.hx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package checkstyle;

import checkstyle.reporter.JSONReporter;
import checkstyle.ChecksInfo;
import checkstyle.checks.Check;
import checkstyle.reporter.ExitCodeReporter;
import checkstyle.reporter.IReporter;
import hxargs.Args;
import haxe.Json;
import sys.FileSystem;
import checkstyle.reporter.XMLReporter;
import checkstyle.reporter.JSONReporter;
import checkstyle.reporter.Reporter;
import checkstyle.reporter.ExitCodeReporter;
import checkstyle.reporter.XMLReporter;
import haxe.CallStack;
import haxe.Json;
import hxargs.Args;
import sys.FileSystem;
import sys.io.File;

class Main {
Expand Down Expand Up @@ -100,15 +101,19 @@ class Main {
else {
var configText = File.getContent(configPath);
var config = Json.parse(configText);
var defaultSeverity = config.defaultSeverity;
var checks:Array<Dynamic> = config.checks;
for (checkConf in checks) {
var check = info.build(checkConf.type);
var check:Check = cast info.build(checkConf.type);
if (checkConf.props != null) {
var props = Reflect.fields(checkConf.props);
for (prop in props) {
var val = Reflect.field(checkConf.props, prop);
Reflect.setField(check, prop, val);
}
if (defaultSeverity != null && props.indexOf("severity") < 0) {
check.severity = defaultSeverity;
}
}
checker.addCheck(check);
}
Expand Down

0 comments on commit c306e92

Please sign in to comment.