From ed59971aed817b04fcb220d6d363f63e5a7be879 Mon Sep 17 00:00:00 2001 From: Zim <60260187+Zim-Inn@users.noreply.github.com> Date: Wed, 6 Aug 2025 11:30:42 +0800 Subject: [PATCH 1/7] Enhance the compatibility of unit testing see the detaill explain at https://github.com/marhali/json5-java/issues/17 --- src/test/java/de/marhali/json5/TestJson5.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/java/de/marhali/json5/TestJson5.java b/src/test/java/de/marhali/json5/TestJson5.java index 5caa3dd..c1bdd50 100644 --- a/src/test/java/de/marhali/json5/TestJson5.java +++ b/src/test/java/de/marhali/json5/TestJson5.java @@ -45,7 +45,10 @@ private String getTestResourceContent(String fileName) throws IOException { buf.write((byte) result); } - return buf.toString(StandardCharsets.UTF_8); + return Optional.ofNullable(buf.toString(StandardCharsets.UTF_8)) + .map(s->s.replace("\r\n","\n")) + .map(s->s.replace("\r","\n")) + .orElse(null); } } From 39ab4567d120967565e6a80442f2a7dd02c2bad5 Mon Sep 17 00:00:00 2001 From: marhali Date: Wed, 3 Sep 2025 21:31:44 +0200 Subject: [PATCH 2/7] fix: add missing import and reformat file --- src/test/java/de/marhali/json5/TestJson5.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/de/marhali/json5/TestJson5.java b/src/test/java/de/marhali/json5/TestJson5.java index c1bdd50..164bd5d 100644 --- a/src/test/java/de/marhali/json5/TestJson5.java +++ b/src/test/java/de/marhali/json5/TestJson5.java @@ -21,6 +21,7 @@ import java.io.*; import java.nio.charset.StandardCharsets; +import java.util.Optional; import static org.junit.jupiter.api.Assertions.*; @@ -45,10 +46,10 @@ private String getTestResourceContent(String fileName) throws IOException { buf.write((byte) result); } - return Optional.ofNullable(buf.toString(StandardCharsets.UTF_8)) - .map(s->s.replace("\r\n","\n")) - .map(s->s.replace("\r","\n")) - .orElse(null); + return Optional.ofNullable(buf.toString(StandardCharsets.UTF_8)) + .map(s->s.replace("\r\n","\n")) + .map(s->s.replace("\r","\n")) + .orElse(null); } } From 0e427292572b2aaf9a5e81e3fd92df58da81acf9 Mon Sep 17 00:00:00 2001 From: marhali Date: Wed, 3 Sep 2025 21:34:01 +0200 Subject: [PATCH 3/7] ci: schedule dependabot monthly --- .github/dependabot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 284463e..67676e9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,10 +4,10 @@ updates: - package-ecosystem: github-actions directory: / schedule: - interval: daily + interval: monthly # Maintain dependencies for Maven - package-ecosystem: maven directory: / schedule: - interval: daily \ No newline at end of file + interval: monthly \ No newline at end of file From 0523ca7e00a6352a487abe7c57db1a1c0090719c Mon Sep 17 00:00:00 2001 From: marhali Date: Wed, 3 Sep 2025 21:48:31 +0200 Subject: [PATCH 4/7] chore: add .editorconfig configuration --- .editorconfig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..291c50a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig is awesome: https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{json,json5}] +indent_size = 2 + +[*.{yml,yaml}] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +[*.{xml,config}] +indent_size = 2 From 80238260d139cf67ab4cedb745f1c6b9abbae0d1 Mon Sep 17 00:00:00 2001 From: marhali Date: Wed, 3 Sep 2025 21:48:45 +0200 Subject: [PATCH 5/7] chore: update dependencies --- .github/workflows/cd.yml | 6 +++--- .github/workflows/ci.yml | 6 +++--- pom.xml | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8b98d3c..02ab996 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v5 with: java-version: '11' distribution: 'adopt' @@ -29,4 +29,4 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 669166e..70f3f14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v5 with: java-version: '11' distribution: 'adopt' @@ -26,7 +26,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v5 with: directory: ./target/site/jacoco/ fail_ci_if_error: true diff --git a/pom.xml b/pom.xml index 53bd15a..1e0bbe0 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ org.junit.jupiter junit-jupiter-engine - 5.8.2 + 5.13.4 test @@ -63,7 +63,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.1 attach-sources @@ -76,7 +76,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.0 + 3.11.3 attach-javadocs @@ -89,17 +89,17 @@ org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.5.3 org.apache.maven.plugins maven-failsafe-plugin - 2.22.2 + 3.5.3 org.jacoco jacoco-maven-plugin - 0.8.7 + 0.8.13 @@ -126,7 +126,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.2.8 sign-artifact @@ -149,4 +149,4 @@ - \ No newline at end of file + From f9a2c5a2cd06bbc5f711d4c991597a4b61cbf8bb Mon Sep 17 00:00:00 2001 From: marhali Date: Wed, 3 Sep 2025 21:56:49 +0200 Subject: [PATCH 6/7] fix(ci): add missing CODECOV_TOKEN --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70f3f14..e833119 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: + token: ${{ secrets.CODECOV_TOKEN }} directory: ./target/site/jacoco/ fail_ci_if_error: true - verbose: true \ No newline at end of file + verbose: true From 18a3a0a82044c2452e8c89e308d850dd723f4522 Mon Sep 17 00:00:00 2001 From: marhali Date: Wed, 3 Sep 2025 22:16:37 +0200 Subject: [PATCH 7/7] chore: prepare patch release --- CHANGELOG.md | 8 +++++++- pom.xml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e235a69..a7c6e31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.0.1] - 2025-09-03 +### Changed +- Update dependencies +### Fixed +- Fix unit tests on Windows (#18) - thanks to @Zim-Inn + ## [2.0.0] - 2022-02-02 ### Changed - For consistency, all methods that return a Json5 data type have been refactored to use the same naming convention @@ -20,4 +26,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Parse json5 data by InputStream / Reader / String - Serialize json5 data to OutputStream / Writer / String - Json5Options with builder pattern (Json5OptionsBuilder) to configure Json5 - - options: allowInvalidSurrogates, quoteSingle, trailingComma, indentFactor \ No newline at end of file + - options: allowInvalidSurrogates, quoteSingle, trailingComma, indentFactor diff --git a/pom.xml b/pom.xml index 1e0bbe0..8830a94 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.marhali json5-java - 2.0.0 + 2.0.1 ${project.groupId}:${project.artifactId} A lightweight library to parse and serialize JSON5 data https://github.com/marhali/json5-java