Skip to content
Merged

Next #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
interval: monthly
6 changes: 3 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -29,4 +29,4 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
verbose: true
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
- options: allowInvalidSurrogates, quoteSingle, trailingComma, indentFactor
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.marhali</groupId>
<artifactId>json5-java</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>A lightweight library to parse and serialize JSON5 data</description>
<url>https://github.com/marhali/json5-java</url>
Expand Down Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
<version>5.13.4</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -63,7 +63,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -76,7 +76,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<version>3.11.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -89,17 +89,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.5.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<version>3.5.3</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<version>0.8.13</version>
<executions>
<execution>
<goals>
Expand All @@ -126,7 +126,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifact</id>
Expand All @@ -149,4 +149,4 @@
</build>
</profile>
</profiles>
</project>
</project>
6 changes: 5 additions & 1 deletion src/test/java/de/marhali/json5/TestJson5.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Optional;

import static org.junit.jupiter.api.Assertions.*;

Expand All @@ -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);
}
}

Expand Down