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 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 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..e833119 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,8 +26,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 + 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 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 53bd15a..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 @@ -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 + diff --git a/src/test/java/de/marhali/json5/TestJson5.java b/src/test/java/de/marhali/json5/TestJson5.java index 5caa3dd..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,7 +46,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); } }