Skip to content

Commit

Permalink
fixed whitespace issue with parens in for, see vshaxe/vshaxe#545 (#658)
Browse files Browse the repository at this point in the history
* fixed whitespace issue with parens in for, see vshaxe/vshaxe#545
* enabled coverage reporting for nightly
  • Loading branch information
AlexHaxe authored Sep 21, 2022
1 parent efbacf9 commit 7b9b526
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ jobs:
# name: formatter.js
# path: bin/formatter.js
- name: Upload results to codecov
if: success() && matrix.platform == 'ubuntu-latest' && (matrix.haxe-version == '4.2.5')
if: success() && matrix.platform == 'ubuntu-latest' && (matrix.haxe-version == 'nightly')
run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## dev branch / next version (1.x.x)

## version 1.14.3 (2022-09-21)

- Fixed whitespace issue in for loops when using parentheses around start value, fixes [vshaxe/vshaxe#545](https://github.com/vshaxe/vshaxe/issues/545) ([#658](https://github.com/HaxeCheckstyle/haxe-formatter/issues/658))

## version 1.14.2 (2022-09-14)

- Updated haxeparser to support latest Haxe nightly syntax ([#657](https://github.com/HaxeCheckstyle/haxe-formatter/issues/657))
Expand Down
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"style"
],
"description": "A code formatter for Haxe",
"version": "1.14.2",
"releasenote": "updated haxeparser to support latest Haxe nightly syntax - see CHANGELOG for details.",
"version": "1.14.3",
"releasenote": "fixed whitespace issue in for loop with parentheses - see CHANGELOG for details.",
"contributors": [
"AlexHaxe",
"Gama11"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@haxecheckstyle/haxe-formatter",
"version": "1.14.2",
"version": "1.14.3",
"description": "A code formatter for Haxe",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/formatter/marker/MarkWhitespace.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MarkWhitespace extends MarkerBase {
markGt(token);
case Spread | Binop(OpInterval):
markOpSpread(token);
case Binop(OpIn):
case Binop(OpIn) | Kwd(KwdIn):
markIn(token);
case Binop(OpMult):
if (TokenTreeCheckUtils.isImport(token.parent)) {
Expand Down
28 changes: 28 additions & 0 deletions test/testcases/whitespace/for_iterator_with_popen.hxtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
}

---

class Main {
static function main() {
for (i in (startLine + 1)...endLine) run();
for (i in (startLine + 1)...(endLine-1)) run();
for (i in startLine + 1...endLine) run();
for (i in startLine + 1...endLine - 1) run();
}
}

---

class Main {
static function main() {
for (i in (startLine + 1)...endLine)
run();
for (i in (startLine + 1)...(endLine - 1))
run();
for (i in startLine + 1...endLine)
run();
for (i in startLine + 1...endLine - 1)
run();
}
}

0 comments on commit 7b9b526

Please sign in to comment.