Skip to content

Commit c62fa4d

Browse files
authored
Make use of import.hx (#327)
1 parent 0dfad5b commit c62fa4d

File tree

113 files changed

+31
-391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+31
-391
lines changed

src/checkstyle/Checker.hx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@ package checkstyle;
33
import byte.ByteData;
44
import haxe.CallStack;
55
import checkstyle.checks.Check;
6-
import haxeparser.Data.TypeDecl;
76
import haxeparser.HaxeParser;
87
import checkstyle.reporter.IReporter;
98
import haxeparser.HaxeLexer;
10-
import haxeparser.Data.Token;
119
import sys.io.File;
1210

1311
import checkstyle.checks.Category;
14-
import checkstyle.token.TokenTree;
1512
import checkstyle.token.TokenTreeBuilder;
1613

17-
using checkstyle.utils.ArrayUtils;
18-
1914
class Checker {
2015

2116
public var file:CheckFile;

src/checkstyle/Main.hx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import hxargs.Args;
1818
import sys.FileSystem;
1919
import sys.io.File;
2020

21-
using checkstyle.utils.ArrayUtils;
22-
2321
class Main {
2422

2523
static var DEFAULT_CONFIG:String = "checkstyle.json";

src/checkstyle/checks/Check.hx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
package checkstyle.checks;
22

3-
import haxe.macro.Expr;
4-
import checkstyle.CheckMessage.SeverityLevel;
5-
63
#if debug
74
import haxe.CallStack;
85
#end
96

10-
using checkstyle.utils.ArrayUtils;
11-
using checkstyle.utils.FieldUtils;
12-
137
class Check {
148

159
public var severity:SeverityLevel;

src/checkstyle/checks/block/ConditionalCompilationCheck.hx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package checkstyle.checks.block;
22

3-
import checkstyle.token.TokenTree;
4-
import checkstyle.Checker.LinePos;
5-
63
@name("ConditionalCompilation")
74
@desc("Checks placement and indentation of conditional compilation flags.")
85
class ConditionalCompilationCheck extends Check {

src/checkstyle/checks/block/EmptyBlockCheck.hx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package checkstyle.checks.block;
22

3-
import checkstyle.token.TokenTree;
4-
5-
using checkstyle.utils.ArrayUtils;
6-
73
@name("EmptyBlock")
84
@desc("Checks for empty blocks. The policy to verify is specified using the property `option`.")
95
class EmptyBlockCheck extends Check {

src/checkstyle/checks/block/LeftCurlyCheck.hx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package checkstyle.checks.block;
22

3-
import checkstyle.token.TokenTree;
4-
import haxe.macro.Expr;
5-
6-
using checkstyle.utils.ArrayUtils;
7-
83
@name("LeftCurly")
94
@desc("Checks for the placement of left curly braces (`{`) for code blocks. The policy to verify is specified using the property `option`.")
105
class LeftCurlyCheck extends Check {

src/checkstyle/checks/block/NeedBracesCheck.hx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
package checkstyle.checks.block;
22

3-
import checkstyle.Checker.LinePos;
4-
import checkstyle.token.TokenTree;
5-
import haxeparser.Data;
6-
7-
using checkstyle.utils.ArrayUtils;
8-
93
@name("NeedBraces")
104
@desc("Checks for braces on function, if, for and while statements. It has an option to allow single line statements without braces using property `allowSingleLineStatement` like `if (b) return 10;`.")
115
class NeedBracesCheck extends Check {

src/checkstyle/checks/block/RightCurlyCheck.hx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
package checkstyle.checks.block;
22

3-
import checkstyle.Checker.LinePos;
4-
import checkstyle.token.TokenTree;
5-
import haxe.macro.Expr;
6-
7-
using checkstyle.utils.ArrayUtils;
8-
93
@name("RightCurly")
104
@desc("Checks the placement of right curly braces (`}`) for code blocks. The policy to verify is specified using the property `option`.")
115
class RightCurlyCheck extends Check {

src/checkstyle/checks/coding/AvoidInlineConditionalsCheck.hx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package checkstyle.checks.coding;
22

3-
import checkstyle.CheckMessage.SeverityLevel;
4-
import checkstyle.utils.ExprUtils;
5-
import haxe.macro.Expr;
6-
73
@name("AvoidInlineConditionals")
84
@desc("Detects inline conditionals. Useful for developers who find inline conditionals hard to read and want forbid them.")
95
class AvoidInlineConditionalsCheck extends Check {
@@ -16,7 +12,7 @@ class AvoidInlineConditionalsCheck extends Check {
1612
}
1713

1814
override function actualRun() {
19-
ExprUtils.walkFile(checker.ast, function(e:Expr) {
15+
checker.ast.walkFile(function(e:Expr) {
2016
if (isPosSuppressed(e.pos)) return;
2117
switch (e.expr){
2218
case ETernary(econd, eif, eelse): logPos("Avoid inline conditionals", e.pos);

src/checkstyle/checks/coding/DefaultComesLastCheck.hx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package checkstyle.checks.coding;
22

3-
import checkstyle.token.TokenTree;
4-
53
@name("DefaultComesLast")
64
@desc("Check that the `default` is after all the cases in a `switch` statement. Haxe allows `default` anywhere within the `switch` statement. But it is more readable if it comes after the last `case`.")
75
class DefaultComesLastCheck extends Check {

0 commit comments

Comments
 (0)