Describe the bug
Wrapping for functionSignature (or maybe it's anonFunctionSignature) kicks in although the line is exactly 80 characters long. However onePerLine rule is not applied as specified in hxformat.json. I suggest that somewhere in your code there is inconsistency in the way you compare line lengths, e.g. the default behavior might be >= maxLineLength (that's why onePerLine is not applied) while the behavior for exceedsMaxLineLength is > maxLineLength.
Input file
function sleep(ms: Int = 0): Promise<Never> {
return new Promise((resolve, reject) -> Timer.delay(() -> resolve(null), ms));
// the line above is exactly 80 characters long
}
Broken output
function sleep(ms: Int = 0): Promise<Never> {
return new Promise((resolve,
reject) -> Timer.delay(() -> resolve(null), ms));
}
Expected output
function sleep(ms: Int = 0): Promise<Never> {
return new Promise((resolve, reject) -> Timer.delay(() -> resolve(null), ms));
}
Optional: hxformat.json
{
"indentation": {
"character": " "
},
"wrapping": {
"maxLineLength": 80,
"callParameter": {
"defaultWrap": "fillLine",
"rules": [
{
"type": "onePerLine",
"conditions": [{ "cond": "exceedsMaxLineLength" }]
}
]
},
"functionSignature": {
"defaultWrap": "fillLine",
"rules": [
{
"type": "onePerLine",
"conditions": [{ "cond": "exceedsMaxLineLength" }]
}
]
},
"anonFunctionSignature": {
"defaultWrap": "fillLine",
"rules": [
{
"type": "onePerLine",
"conditions": [{ "cond": "exceedsMaxLineLength" }]
}
]
}
},
"whitespace": {
"typeHintColonPolicy": "after",
"bracesConfig": {
"anonTypeBraces": {
"openingPolicy": "around",
"closingPolicy": "before"
},
"objectLiteralBraces": {
"openingPolicy": "around",
"closingPolicy": "before"
},
"typedefBraces": {
"openingPolicy": "around",
"closingPolicy": "before"
}
}
}
}
Describe the bug
Wrapping for
functionSignature(or maybe it'sanonFunctionSignature) kicks in although the line is exactly 80 characters long. HoweveronePerLinerule is not applied as specified inhxformat.json. I suggest that somewhere in your code there is inconsistency in the way you compare line lengths, e.g. the default behavior might be>= maxLineLength(that's whyonePerLineis not applied) while the behavior forexceedsMaxLineLengthis> maxLineLength.Input file
Broken output
Expected output
Optional: hxformat.json
{ "indentation": { "character": " " }, "wrapping": { "maxLineLength": 80, "callParameter": { "defaultWrap": "fillLine", "rules": [ { "type": "onePerLine", "conditions": [{ "cond": "exceedsMaxLineLength" }] } ] }, "functionSignature": { "defaultWrap": "fillLine", "rules": [ { "type": "onePerLine", "conditions": [{ "cond": "exceedsMaxLineLength" }] } ] }, "anonFunctionSignature": { "defaultWrap": "fillLine", "rules": [ { "type": "onePerLine", "conditions": [{ "cond": "exceedsMaxLineLength" }] } ] } }, "whitespace": { "typeHintColonPolicy": "after", "bracesConfig": { "anonTypeBraces": { "openingPolicy": "around", "closingPolicy": "before" }, "objectLiteralBraces": { "openingPolicy": "around", "closingPolicy": "before" }, "typedefBraces": { "openingPolicy": "around", "closingPolicy": "before" } } } }