From 7d4e708f6ee2d6446126fdf873b87e38a36af3da Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenko Date: Thu, 3 Nov 2016 13:38:05 +0300 Subject: [PATCH 1/5] Initial implementation for #302 --- .gitignore | 2 + resources/default-config.json | 6 +-- src/checkstyle/Main.hx | 10 +++- src/checkstyle/checks/Check.hx | 4 ++ src/checkstyle/checks/Directive.hx | 34 +++++++++++++ .../checks/whitespace/SpacingCheck.hx | 50 +++++++++++++------ src/checkstyle/errors/Error.hx | 13 +++++ .../errors/InvalidDirectiveError.hx | 3 ++ test/checks/whitespace/SpacingCheckTest.hx | 32 ++++++++++-- 9 files changed, 132 insertions(+), 22 deletions(-) create mode 100644 src/checkstyle/checks/Directive.hx create mode 100644 src/checkstyle/errors/Error.hx create mode 100644 src/checkstyle/errors/InvalidDirectiveError.hx diff --git a/.gitignore b/.gitignore index aae9f07d..27f08967 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ target/ check-style-report.json check-style-report.xml coverage.json + +display.hxml diff --git a/resources/default-config.json b/resources/default-config.json index 59b45feb..c853e5b4 100644 --- a/resources/default-config.json +++ b/resources/default-config.json @@ -442,11 +442,11 @@ }, { "props": { - "spaceIfCondition": true, + "spaceIfCondition": "should", "spaceAroundBinop": true, - "spaceForLoop": true, + "spaceForLoop": "should", "ignoreRangeOperator": true, - "spaceWhileLoop": true, + "spaceWhileLoop": "should", "spaceCatch": true, "spaceSwitchCase": true, "noSpaceAroundUnop": true diff --git a/src/checkstyle/Main.hx b/src/checkstyle/Main.hx index 3a0ef213..71333c16 100644 --- a/src/checkstyle/Main.hx +++ b/src/checkstyle/Main.hx @@ -11,6 +11,7 @@ import checkstyle.reporter.TextReporter; import checkstyle.reporter.XMLReporter; import checkstyle.reporter.CodeClimateReporter; import checkstyle.reporter.ExitCodeReporter; +import checkstyle.errors.Error; import haxe.CallStack; import haxe.Json; import hxargs.Args; @@ -181,7 +182,14 @@ class Main { if (!checkFields.contains(prop)) { failWith('Check ${check.getModuleName()} has no property named \'$prop\''); } - Reflect.setField(check, prop, val); + try { + check.configureProperty(prop, val); + } + catch (e:Dynamic) { + var message = 'Failed to configure $prop setting for ${check.getModuleName()}: '; + message += (Std.is(e, Error) ? (e:Error).message : Std.string(message)); + failWith(e.message); + } } if (defaultSeverity != null && !props.contains("severity")) check.severity = defaultSeverity; } diff --git a/src/checkstyle/checks/Check.hx b/src/checkstyle/checks/Check.hx index 94bc090f..b6fd3abf 100644 --- a/src/checkstyle/checks/Check.hx +++ b/src/checkstyle/checks/Check.hx @@ -31,6 +31,10 @@ class Check { desc = haxe.rtti.Meta.getType(Type.getClass(this)).desc[0]; } + public function configureProperty(name:String, value:Any) { + Reflect.setField(this, name, value); + } + public function run(checker:Checker):Array { this.checker = checker; messages = []; diff --git a/src/checkstyle/checks/Directive.hx b/src/checkstyle/checks/Directive.hx new file mode 100644 index 00000000..d61ce755 --- /dev/null +++ b/src/checkstyle/checks/Directive.hx @@ -0,0 +1,34 @@ +package checkstyle.checks; + +import Type.ValueType; +import checkstyle.errors.InvalidDirectiveError; + +@:enum +abstract Directive(String) to String { + var SHOULD = "should"; + var SHOULD_NOT = "shouldNot"; + var ANY = "any"; + + @:from + public static function fromAny(value:Any):Directive { + return switch (Type.typeof(value)) { + case ValueType.TClass(String): getValidated(value); + //support for legacy configs when such settings were boolean + case ValueType.TBool: (value ? SHOULD : ANY); + case _: ANY; + } + } + + @:from + static inline function fromString(value:String):Directive { + return getValidated(value); + } + + static function getValidated(value:String):Directive { + switch (value:Directive) { + case SHOULD, SHOULD_NOT, ANY: + return value; + } + throw new InvalidDirectiveError('Invalid directive: $value'); + } +} \ No newline at end of file diff --git a/src/checkstyle/checks/whitespace/SpacingCheck.hx b/src/checkstyle/checks/whitespace/SpacingCheck.hx index 7daf112b..f75737c1 100644 --- a/src/checkstyle/checks/whitespace/SpacingCheck.hx +++ b/src/checkstyle/checks/whitespace/SpacingCheck.hx @@ -1,5 +1,6 @@ package checkstyle.checks.whitespace; +import Type.ValueType; import checkstyle.utils.ExprUtils; import haxe.macro.Expr; import haxe.macro.Printer; @@ -12,9 +13,9 @@ class SpacingCheck extends Check { public var spaceAroundBinop:Bool; public var noSpaceAroundUnop:Bool; - public var spaceIfCondition:Bool; - public var spaceForLoop:Bool; - public var spaceWhileLoop:Bool; + public var spaceIfCondition:Directive; + public var spaceForLoop:Directive; + public var spaceWhileLoop:Directive; public var spaceSwitchCase:Bool; public var spaceCatch:Bool; public var ignoreRangeOperator:Bool; @@ -23,15 +24,26 @@ class SpacingCheck extends Check { super(AST); spaceAroundBinop = true; noSpaceAroundUnop = true; - spaceIfCondition = true; - spaceForLoop = true; - spaceWhileLoop = true; + spaceIfCondition = SHOULD; + spaceForLoop = SHOULD; + spaceWhileLoop = SHOULD; spaceSwitchCase = true; spaceCatch = true; ignoreRangeOperator = true; categories = [Category.STYLE, Category.CLARITY]; } + override public function configureProperty(name:String, value:Any) { + var currentValue = Reflect.field(this, name); + + switch (Type.typeof(currentValue)) { + case ValueType.TClass(String): + Reflect.setField(this, name, (value:Directive)); + case _: + super.configureProperty(name, value); + } + } + override function actualRun() { var lastExpr = null; @@ -50,12 +62,12 @@ class SpacingCheck extends Check { if (post) dist = e.pos.max - e2.pos.max; else dist = e2.pos.min - e.pos.min; if (dist > unopSize(uo)) logPos('Space around "${unopString(uo)}"', e.pos); - case EIf(econd, _, _) if (spaceIfCondition): - checkSpaceBetweenExpressions("if", e, econd); - case EFor(it, _) if (spaceForLoop): - checkSpaceBetweenExpressions("for", e, it); - case EWhile(econd, _, true) if (spaceWhileLoop): - checkSpaceBetweenExpressions("while", e, econd); + case EIf(econd, _, _): + checkSpaceBetweenExpressions("if", e, econd, spaceIfCondition); + case EFor(it, _): + checkSpaceBetweenExpressions("for", e, it, spaceForLoop); + case EWhile(econd, _, true): + checkSpaceBetweenExpressions("while", e, econd, spaceWhileLoop); case ESwitch(eswitch, _, _) if (spaceSwitchCase): checkSpaceBetweenManually("switch", lastExpr, eswitch); case ETry(etry, catches) if (spaceCatch): @@ -87,9 +99,17 @@ class SpacingCheck extends Check { return (new Printer()).printUnop(uo); } - function checkSpaceBetweenExpressions(name:String, e1:Expr, e2:Expr) { - if (e2.pos.min - e1.pos.min < '$name ('.length) { - logRange('No space between "$name" and "("', e1.pos.max, e2.pos.min); + function checkSpaceBetweenExpressions(name:String, e1:Expr, e2:Expr, directive:Directive = SHOULD) { + switch (directive) { + case ANY: + case SHOULD_NOT: + if (e2.pos.min - e1.pos.min > '$name('.length) { + logRange('Space between "$name" and "("', e1.pos.max, e2.pos.min); + } + case SHOULD: + if (e2.pos.min - e1.pos.min < '$name ('.length) { + logRange('No space between "$name" and "("', e1.pos.max, e2.pos.min); + } } } diff --git a/src/checkstyle/errors/Error.hx b/src/checkstyle/errors/Error.hx new file mode 100644 index 00000000..d29fe499 --- /dev/null +++ b/src/checkstyle/errors/Error.hx @@ -0,0 +1,13 @@ +package checkstyle.errors; + +class Error { + public var message (default, null):String; + + public function new(message:String) { + this.message = message; + } + + public function toString():String { + return message; + } +} \ No newline at end of file diff --git a/src/checkstyle/errors/InvalidDirectiveError.hx b/src/checkstyle/errors/InvalidDirectiveError.hx new file mode 100644 index 00000000..98a562a0 --- /dev/null +++ b/src/checkstyle/errors/InvalidDirectiveError.hx @@ -0,0 +1,3 @@ +package checkstyle.errors; + +class InvalidDirectiveError extends Error {} \ No newline at end of file diff --git a/test/checks/whitespace/SpacingCheckTest.hx b/test/checks/whitespace/SpacingCheckTest.hx index 1418dc2e..3c092a63 100644 --- a/test/checks/whitespace/SpacingCheckTest.hx +++ b/test/checks/whitespace/SpacingCheckTest.hx @@ -1,14 +1,23 @@ package checks.whitespace; import checkstyle.checks.whitespace.SpacingCheck; +import checkstyle.checks.Directive; class SpacingCheckTest extends CheckTestCase { - public function testIf() { + public function testIfShouldContainSpace() { assertMsg(new SpacingCheck(), TEST1A, 'No space between "if" and "("'); assertNoMsg(new SpacingCheck(), TEST1B); } + public function testIfShouldNotContainSpace() { + var check = new SpacingCheck(); + check.spaceIfCondition = Directive.SHOULD_NOT; + + assertMsg(check, TEST1B, 'Space between "if" and "("'); + assertNoMsg(check, TEST1A); + } + public function testBinaryOperator() { assertMsg(new SpacingCheck(), TEST2, 'No space around "+"'); } @@ -17,16 +26,32 @@ class SpacingCheckTest extends CheckTestCase { assertMsg(new SpacingCheck(), TEST3, 'Space around "++"'); } - public function testFor() { + public function testForShouldContainSpace() { assertMsg(new SpacingCheck(), TEST4A, 'No space between "for" and "("'); assertNoMsg(new SpacingCheck(), TEST4B); } - public function testWhile() { + public function testForShouldNotContainSpace() { + var check = new SpacingCheck(); + check.spaceForLoop = Directive.SHOULD_NOT; + + assertMsg(check, TEST4B, 'Space between "for" and "("'); + assertNoMsg(check, TEST4A); + } + + public function testWhileShouldContainSpace() { assertMsg(new SpacingCheck(), TEST5A, 'No space between "while" and "("'); assertNoMsg(new SpacingCheck(), TEST5B); } + public function testWhileShouldNotContainSpace() { + var check = new SpacingCheck(); + check.spaceWhileLoop = Directive.SHOULD_NOT; + + assertMsg(check, TEST5B, 'Space between "while" and "("'); + assertNoMsg(check, TEST5A); + } + public function testSwitch() { assertMsg(new SpacingCheck(), TEST6A, 'No space between "switch" and "("'); assertNoMsg(new SpacingCheck(), TEST6B); @@ -54,6 +79,7 @@ abstract SpacingCheckTests(String) to String { } }"; + var TEST2 = "class Test { public function test() { From 65d51a4c6be269e9fd7581bfd29f570c5b8ce0b1 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenko Date: Thu, 3 Nov 2016 13:53:02 +0300 Subject: [PATCH 2/5] Change spacing settings for switch and catch to Directive --- resources/default-config.json | 4 +-- .../checks/whitespace/SpacingCheck.hx | 35 ++++++++++++------- test/checks/whitespace/SpacingCheckTest.hx | 20 +++++++++-- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/resources/default-config.json b/resources/default-config.json index c853e5b4..16f93b5d 100644 --- a/resources/default-config.json +++ b/resources/default-config.json @@ -447,8 +447,8 @@ "spaceForLoop": "should", "ignoreRangeOperator": true, "spaceWhileLoop": "should", - "spaceCatch": true, - "spaceSwitchCase": true, + "spaceCatch": "should", + "spaceSwitchCase": "should", "noSpaceAroundUnop": true }, "type": "Spacing" diff --git a/src/checkstyle/checks/whitespace/SpacingCheck.hx b/src/checkstyle/checks/whitespace/SpacingCheck.hx index f75737c1..716b1df8 100644 --- a/src/checkstyle/checks/whitespace/SpacingCheck.hx +++ b/src/checkstyle/checks/whitespace/SpacingCheck.hx @@ -16,8 +16,8 @@ class SpacingCheck extends Check { public var spaceIfCondition:Directive; public var spaceForLoop:Directive; public var spaceWhileLoop:Directive; - public var spaceSwitchCase:Bool; - public var spaceCatch:Bool; + public var spaceSwitchCase:Directive; + public var spaceCatch:Directive; public var ignoreRangeOperator:Bool; public function new() { @@ -27,8 +27,8 @@ class SpacingCheck extends Check { spaceIfCondition = SHOULD; spaceForLoop = SHOULD; spaceWhileLoop = SHOULD; - spaceSwitchCase = true; - spaceCatch = true; + spaceSwitchCase = SHOULD; + spaceCatch = SHOULD; ignoreRangeOperator = true; categories = [Category.STYLE, Category.CLARITY]; } @@ -68,12 +68,12 @@ class SpacingCheck extends Check { checkSpaceBetweenExpressions("for", e, it, spaceForLoop); case EWhile(econd, _, true): checkSpaceBetweenExpressions("while", e, econd, spaceWhileLoop); - case ESwitch(eswitch, _, _) if (spaceSwitchCase): - checkSpaceBetweenManually("switch", lastExpr, eswitch); - case ETry(etry, catches) if (spaceCatch): + case ESwitch(eswitch, _, _): + checkSpaceBetweenManually("switch", lastExpr, eswitch, spaceSwitchCase); + case ETry(etry, catches): var exprBeforeCatch = lastExpr; for (ctch in catches) { - checkSpaceBetweenManually("catch", exprBeforeCatch, ctch.expr); + checkSpaceBetweenManually("catch", exprBeforeCatch, ctch.expr, spaceCatch); exprBeforeCatch = ctch.expr; } default: @@ -99,7 +99,7 @@ class SpacingCheck extends Check { return (new Printer()).printUnop(uo); } - function checkSpaceBetweenExpressions(name:String, e1:Expr, e2:Expr, directive:Directive = SHOULD) { + function checkSpaceBetweenExpressions(name:String, e1:Expr, e2:Expr, directive:Directive) { switch (directive) { case ANY: case SHOULD_NOT: @@ -113,12 +113,21 @@ class SpacingCheck extends Check { } } - function checkSpaceBetweenManually(name:String, before:Expr, check:Expr) { + function checkSpaceBetweenManually(name:String, before:Expr, check:Expr, directive:Directive) { var prevExprUntilChecked = checker.file.content.substring(before.pos.min, check.pos.min + 1); var checkPos = prevExprUntilChecked.lastIndexOf('$name('); - if (checkPos > -1) { - var fileCheckPos = before.pos.min + checkPos; - logRange('No space between "$name" and "("', fileCheckPos, fileCheckPos + '$name('.length); + var fileCheckPos = before.pos.min + checkPos; + + switch (directive) { + case ANY: + case SHOULD_NOT: + if (checkPos < 0) { + logRange('Space between "$name" and "("', fileCheckPos, fileCheckPos + '$name ('.length); + } + case SHOULD: + if (checkPos > -1) { + logRange('No space between "$name" and "("', fileCheckPos, fileCheckPos + '$name('.length); + } } } } \ No newline at end of file diff --git a/test/checks/whitespace/SpacingCheckTest.hx b/test/checks/whitespace/SpacingCheckTest.hx index 3c092a63..0e49fae4 100644 --- a/test/checks/whitespace/SpacingCheckTest.hx +++ b/test/checks/whitespace/SpacingCheckTest.hx @@ -52,15 +52,31 @@ class SpacingCheckTest extends CheckTestCase { assertNoMsg(check, TEST5A); } - public function testSwitch() { + public function testSwitchShouldContainSpace() { assertMsg(new SpacingCheck(), TEST6A, 'No space between "switch" and "("'); assertNoMsg(new SpacingCheck(), TEST6B); } - public function testCatch() { + public function testSwitchShouldNotContainSpace() { + var check = new SpacingCheck(); + check.spaceSwitchCase = Directive.SHOULD_NOT; + + assertMsg(check, TEST6B, 'Space between "switch" and "("'); + assertNoMsg(check, TEST6A); + } + + public function testCatchShouldContainSpace() { assertMsg(new SpacingCheck(), TEST7A, 'No space between "catch" and "("'); assertNoMsg(new SpacingCheck(), TEST7B); } + + public function testCatchShouldNotContainSpace() { + var check = new SpacingCheck(); + check.spaceCatch = Directive.SHOULD_NOT; + + assertMsg(check, TEST7B, 'Space between "catch" and "("'); + assertNoMsg(check, TEST7A); + } } @:enum From 736d288ef9e34c9107930c108780863626aa7666 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenko Date: Thu, 3 Nov 2016 15:52:01 +0300 Subject: [PATCH 3/5] made Directive a real enum to avoid issues with other string settings in config --- checkstyle.json | 3 ++ resources/default-config.json | 10 +++--- src/checkstyle/Main.hx | 2 +- src/checkstyle/checks/Check.hx | 2 +- src/checkstyle/checks/Directive.hx | 31 +++++++++---------- .../checks/whitespace/SpacingCheck.hx | 7 +++-- 6 files changed, 29 insertions(+), 26 deletions(-) diff --git a/checkstyle.json b/checkstyle.json index a301cd38..a0f96d1a 100644 --- a/checkstyle.json +++ b/checkstyle.json @@ -517,6 +517,9 @@ "checkstyle.Main", "checkstyle.Checker", "checkstyle.ChecksInfo", + "checkstyle.checks.Check", + "checkstyle.checks.Directive", + "checkstyle.checks.whitespace.SpacingCheck", "checkstyle.checks.imports.UnusedImportCheck", "TestMain", "misc.ExtensionsTest", diff --git a/resources/default-config.json b/resources/default-config.json index 16f93b5d..1fd29050 100644 --- a/resources/default-config.json +++ b/resources/default-config.json @@ -442,13 +442,13 @@ }, { "props": { - "spaceIfCondition": "should", + "spaceIfCondition": 0, "spaceAroundBinop": true, - "spaceForLoop": "should", + "spaceForLoop": 0, "ignoreRangeOperator": true, - "spaceWhileLoop": "should", - "spaceCatch": "should", - "spaceSwitchCase": "should", + "spaceWhileLoop": 0, + "spaceCatch": 0, + "spaceSwitchCase": 0, "noSpaceAroundUnop": true }, "type": "Spacing" diff --git a/src/checkstyle/Main.hx b/src/checkstyle/Main.hx index 71333c16..e88ae0f3 100644 --- a/src/checkstyle/Main.hx +++ b/src/checkstyle/Main.hx @@ -188,7 +188,7 @@ class Main { catch (e:Dynamic) { var message = 'Failed to configure $prop setting for ${check.getModuleName()}: '; message += (Std.is(e, Error) ? (e:Error).message : Std.string(message)); - failWith(e.message); + failWith(message); } } if (defaultSeverity != null && !props.contains("severity")) check.severity = defaultSeverity; diff --git a/src/checkstyle/checks/Check.hx b/src/checkstyle/checks/Check.hx index b6fd3abf..0ec2bcfb 100644 --- a/src/checkstyle/checks/Check.hx +++ b/src/checkstyle/checks/Check.hx @@ -31,7 +31,7 @@ class Check { desc = haxe.rtti.Meta.getType(Type.getClass(this)).desc[0]; } - public function configureProperty(name:String, value:Any) { + public function configureProperty(name:String, value:Dynamic) { Reflect.setField(this, name, value); } diff --git a/src/checkstyle/checks/Directive.hx b/src/checkstyle/checks/Directive.hx index d61ce755..41abea6a 100644 --- a/src/checkstyle/checks/Directive.hx +++ b/src/checkstyle/checks/Directive.hx @@ -3,14 +3,20 @@ package checkstyle.checks; import Type.ValueType; import checkstyle.errors.InvalidDirectiveError; -@:enum -abstract Directive(String) to String { - var SHOULD = "should"; - var SHOULD_NOT = "shouldNot"; - var ANY = "any"; +enum Directive { + SHOULD; + SHOULD_NOT; + ANY; +} - @:from - public static function fromAny(value:Any):Directive { +class DirectiveTools { + static var MAPPING:Map = [ + "should" => SHOULD, + "shouldNot" => SHOULD_NOT, + "any" => ANY + ]; + + public static function fromDynamic(value:Dynamic):Directive { return switch (Type.typeof(value)) { case ValueType.TClass(String): getValidated(value); //support for legacy configs when such settings were boolean @@ -19,16 +25,9 @@ abstract Directive(String) to String { } } - @:from - static inline function fromString(value:String):Directive { - return getValidated(value); - } - static function getValidated(value:String):Directive { - switch (value:Directive) { - case SHOULD, SHOULD_NOT, ANY: - return value; - } + var directive = MAPPING.get(value); + if (directive != null) return directive; throw new InvalidDirectiveError('Invalid directive: $value'); } } \ No newline at end of file diff --git a/src/checkstyle/checks/whitespace/SpacingCheck.hx b/src/checkstyle/checks/whitespace/SpacingCheck.hx index 716b1df8..218bdeab 100644 --- a/src/checkstyle/checks/whitespace/SpacingCheck.hx +++ b/src/checkstyle/checks/whitespace/SpacingCheck.hx @@ -6,6 +6,7 @@ import haxe.macro.Expr; import haxe.macro.Printer; import haxe.macro.Expr.Binop; import haxe.macro.Expr.Unop; +import checkstyle.checks.Directive; @name("Spacing") @desc("Spacing check on if, for, while, switch, try statements and around operators.") @@ -33,12 +34,12 @@ class SpacingCheck extends Check { categories = [Category.STYLE, Category.CLARITY]; } - override public function configureProperty(name:String, value:Any) { + override public function configureProperty(name:String, value:Dynamic) { var currentValue = Reflect.field(this, name); switch (Type.typeof(currentValue)) { - case ValueType.TClass(String): - Reflect.setField(this, name, (value:Directive)); + case ValueType.TEnum(Directive): + Reflect.setField(this, name, DirectiveTools.fromDynamic(value)); case _: super.configureProperty(name, value); } From 184bab380257a70ff0a56322f5c454d6a29c85d2 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenko Date: Thu, 3 Nov 2016 16:05:02 +0300 Subject: [PATCH 4/5] fix position reporting for SpacingCheck if checking absence of spaces --- src/checkstyle/checks/whitespace/SpacingCheck.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkstyle/checks/whitespace/SpacingCheck.hx b/src/checkstyle/checks/whitespace/SpacingCheck.hx index 218bdeab..9c8aa8ce 100644 --- a/src/checkstyle/checks/whitespace/SpacingCheck.hx +++ b/src/checkstyle/checks/whitespace/SpacingCheck.hx @@ -105,7 +105,7 @@ class SpacingCheck extends Check { case ANY: case SHOULD_NOT: if (e2.pos.min - e1.pos.min > '$name('.length) { - logRange('Space between "$name" and "("', e1.pos.max, e2.pos.min); + logRange('Space between "$name" and "("', e2.pos.max, e2.pos.min); } case SHOULD: if (e2.pos.min - e1.pos.min < '$name ('.length) { @@ -123,7 +123,7 @@ class SpacingCheck extends Check { case ANY: case SHOULD_NOT: if (checkPos < 0) { - logRange('Space between "$name" and "("', fileCheckPos, fileCheckPos + '$name ('.length); + logRange('Space between "$name" and "("', check.pos.min, check.pos.max); } case SHOULD: if (checkPos > -1) { From 484da599a2ece2e35dc9b3d339dcc59c7b782e4e Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenko Date: Thu, 3 Nov 2016 16:11:04 +0300 Subject: [PATCH 5/5] typo --- src/checkstyle/Main.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checkstyle/Main.hx b/src/checkstyle/Main.hx index e88ae0f3..28a4a4cd 100644 --- a/src/checkstyle/Main.hx +++ b/src/checkstyle/Main.hx @@ -187,7 +187,7 @@ class Main { } catch (e:Dynamic) { var message = 'Failed to configure $prop setting for ${check.getModuleName()}: '; - message += (Std.is(e, Error) ? (e:Error).message : Std.string(message)); + message += (Std.is(e, Error) ? (e:Error).message : Std.string(e)); failWith(message); } }