From 3f0103fffc645f3f70082ba582edc8551e4d8a6f Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Tue, 22 Oct 2024 14:58:42 +0200 Subject: [PATCH] fixed WhitespacePolicy compile error --- CHANGELOG.md | 4 ++++ haxelib.json | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- resources/default-hxformat.json | 14 -------------- resources/hxformat-schema.json | 4 ---- src/formatter/config/WhitespacePolicy.hx | 2 +- 7 files changed, 10 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29cf730..c52ec1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## dev branch / next version (1.x.x) +## version 1.17.1 (2024-10-22) + +- Fixed WhitespacePolicy compilation error + ## version 1.17.0 (2024-10-06) - **Breaking Change** replaced `whitespace.openingBracketPolicy` and `whitespace.closingBracketPolicy` settings with `whitespace.bracketConfig`, fixes [#592](https://github.com/HaxeCheckstyle/haxe-formatter/issues/592) diff --git a/haxelib.json b/haxelib.json index 94b05dc..14ed43a 100644 --- a/haxelib.json +++ b/haxelib.json @@ -8,8 +8,8 @@ "style" ], "description": "A code formatter for Haxe", - "version": "1.17.0", - "releasenote": "Added more wrapping conditions; fixed various issues affecting a whole bunch of special cases - see CHANGELOG for details.", + "version": "1.17.1", + "releasenote": "Fixed WhitespacePolicy error - see CHANGELOG for details.", "contributors": [ "AlexHaxe", "Gama11" diff --git a/package-lock.json b/package-lock.json index 3fd2713..ca6d5ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.17.0", + "version": "1.17.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.17.0", + "version": "1.17.1", "license": "MIT", "bin": { "haxe-formatter": "bin/formatter.js" diff --git a/package.json b/package.json index 76bafd2..828fadb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.17.0", + "version": "1.17.1", "description": "A code formatter for Haxe", "repository": { "type": "git", diff --git a/resources/default-hxformat.json b/resources/default-hxformat.json index 88845ed..ce9c13b 100644 --- a/resources/default-hxformat.json +++ b/resources/default-hxformat.json @@ -921,20 +921,6 @@ } ] }, - "opAssignWrap": { - "defaultWrap": "noWrap", - "rules": [ - { - "conditions": [ - { - "cond": "exceedsMaxLineLength", - "value": 1 - } - ], - "type": "fillLineWithLeadingBreak" - } - ] - }, "opBoolChain": { "defaultWrap": "noWrap", "rules": [ diff --git a/resources/hxformat-schema.json b/resources/hxformat-schema.json index 60f07c1..e353a7b 100644 --- a/resources/hxformat-schema.json +++ b/resources/hxformat-schema.json @@ -1283,10 +1283,6 @@ "description": "call parameter wrapping rules", "$ref": "#/definitions/formatter.config.WrapRules" }, - "opAssignWrap": { - "description": "chain wrapping rules for case patterns", - "$ref": "#/definitions/formatter.config.WrapRules" - }, "arrayMatrixWrap": { "description": "detect arrays in matrix configuration from source noMatrixWrap = no detection matrixWrapNoAlign = detect and format as matrix without alignment matrixWrapWithAlign = detect and format as matrix and align columns", "$ref": "#/definitions/formatter.config.ArrayMatrixWrap", diff --git a/src/formatter/config/WhitespacePolicy.hx b/src/formatter/config/WhitespacePolicy.hx index f32b0f6..e8a50a1 100644 --- a/src/formatter/config/WhitespacePolicy.hx +++ b/src/formatter/config/WhitespacePolicy.hx @@ -11,7 +11,7 @@ enum abstract WhitespacePolicy(String) { var Around = "around"; public static function has(policy:WhitespacePolicy, wantPolicy:WhitespacePolicy):Bool { - return (policy.remove(wantPolicy) != policy); + return (remove(policy, wantPolicy) != policy); } public static function remove(policy:WhitespacePolicy, removePolicy:WhitespacePolicy):WhitespacePolicy {