Skip to content

Commit 51c4330

Browse files
authored
fix wrap check for Dot in IndentationCheck (#403)
* fix wrap check for Dot
1 parent 7aa7a85 commit 51c4330

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- Added unittests for ParserQueue and CheckerPool [#393](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/393)
1212
- Added unittests for TokenTree structure verification [#400](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/400)
1313
- Removed `.` from default settings in SeparatorWrapCheck [#400](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/400)
14-
- Improved wrapped code detection [#392](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/392)
14+
- Improved wrapped code detection [#392](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/392) + [#403](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/403)
1515

1616
## version 2.2.1
1717

src/checkstyle/checks/whitespace/IndentationCheck.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ class IndentationCheck extends Check {
193193
for (token in tokenList) {
194194
var pos = token.getPos();
195195
var child:TokenTree = token.getFirstChild();
196+
if (token.is(Dot)) pos = token.parent.getPos();
196197
if (child.is(BkOpen)) continue;
197198
ignoreRange(pos, wrapped);
198199
}

test/checks/whitespace/IndentationCheckTest.hx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ long comment
162162
.data()
163163
.build()
164164
.run();
165+
builder
166+
.create
167+
.something();
165168
}
166169
}
167170
/*

0 commit comments

Comments
 (0)