Skip to content

Commit

Permalink
expanded whitespace options for parens and braces, fixes #251 (#282)
Browse files Browse the repository at this point in the history
* expanded whitespace options for parens and braces, fixes #251
* removed CompileTime.getAllClasses since it uses Context.onMacroContextReused (see HaxeFoundation/haxe#5746)
  • Loading branch information
AlexHaxe authored Dec 1, 2018
1 parent 3dfd0f6 commit 4c0e90f
Show file tree
Hide file tree
Showing 15 changed files with 588 additions and 219 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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

- **Breaking Change** replaced `whitespace.openingParenPolicy` and `whitespace.closingParenPolicy` settings with `whitespace.parenConfig` [#282](https://github.com/HaxeCheckstyle/haxe-formatter/issues/282)
- **Breaking Change** replaced `whitespace.openingBracePolicy` `whitespace.closingBracePolicy`, `whitespace.objectOpeningBracePolicy` and `whitespace.objectClosingBracePolicy` settings with `whitespace.bracesConfig` [#282](https://github.com/HaxeCheckstyle/haxe-formatter/issues/282)
- Added check to prevent tokentree parser issues from deleting code [#281](https://github.com/HaxeCheckstyle/haxe-formatter/issues/281)
- Fixed properties in anon types [#276](https://github.com/HaxeCheckstyle/haxe-formatter/issues/276)
- Fixed empty lines between single line types with meta [#277](https://github.com/HaxeCheckstyle/haxe-formatter/issues/277)
Expand Down
70 changes: 64 additions & 6 deletions resources/default-hxformat.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,36 @@
"whitespace": {
"arrowFunctionsPolicy": "around",
"binopPolicy": "around",
"bracesConfig": {
"anonTypeBraces": {
"openingPolicy": "before",
"closingPolicy": "onlyAfter",
"removeInnerWhenEmpty": true
},
"blockBraces": {
"openingPolicy": "before",
"closingPolicy": "onlyAfter",
"removeInnerWhenEmpty": true
},
"objectLiteralBraces": {
"openingPolicy": "before",
"closingPolicy": "onlyAfter",
"removeInnerWhenEmpty": true
},
"typedefBraces": {
"openingPolicy": "before",
"closingPolicy": "onlyAfter",
"removeInnerWhenEmpty": true
},
"unknownBraces": {
"openingPolicy": "before",
"closingPolicy": "onlyAfter",
"removeInnerWhenEmpty": true
}
},
"caseColonPolicy": "onlyAfter",
"catchPolicy": "after",
"closingBracePolicy": "after",
"closingBracketPolicy": "none",
"closingParenPolicy": "onlyAfter",
"colonPolicy": "none",
"commaPolicy": "onlyAfter",
"compressSuccessiveParenthesis": true,
Expand All @@ -147,12 +172,45 @@
"functionTypeHaxe4Policy": "around",
"ifPolicy": "after",
"intervalPolicy": "none",
"objectClosingBracePolicy": "onlyAfter",
"objectFieldColonPolicy": "after",
"objectOpeningBracePolicy": "onlyBefore",
"openingBracePolicy": "before",
"openingBracketPolicy": "noneAfter",
"openingParenPolicy": "noneAfter",
"parenConfig": {
"anonFuncParamParens": {
"closingPolicy": "onlyAfter",
"openingPolicy": "none",
"removeInnerWhenEmpty": true
},
"callParens": {
"closingPolicy": "onlyAfter",
"openingPolicy": "none",
"removeInnerWhenEmpty": true
},
"conditionParens": {
"openingPolicy": "noneAfter",
"closingPolicy": "onlyAfter",
"removeInnerWhenEmpty": true
},
"expressionParens": {
"openingPolicy": "noneAfter",
"closingPolicy": "onlyAfter",
"removeInnerWhenEmpty": true
},
"forLoopParens": {
"openingPolicy": "noneAfter",
"closingPolicy": "onlyAfter",
"removeInnerWhenEmpty": true
},
"funcParamParens": {
"closingPolicy": "onlyAfter",
"openingPolicy": "none",
"removeInnerWhenEmpty": true
},
"metadataParens": {
"closingPolicy": "onlyAfter",
"openingPolicy": "none",
"removeInnerWhenEmpty": true
}
},
"semicolonPolicy": "onlyAfter",
"switchPolicy": "after",
"ternaryPolicy": "around",
Expand Down
Loading

0 comments on commit 4c0e90f

Please sign in to comment.