Skip to content

Commit af951cb

Browse files
authored
Merge pull request #19 from marhali/next
Next
2 parents d220224 + 18a3a0a commit af951cb

7 files changed

Lines changed: 52 additions & 20 deletions

File tree

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# EditorConfig is awesome: https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{json,json5}]
12+
indent_size = 2
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
[*.{xml,config}]
21+
indent_size = 2

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ updates:
44
- package-ecosystem: github-actions
55
directory: /
66
schedule:
7-
interval: daily
7+
interval: monthly
88

99
# Maintain dependencies for Maven
1010
- package-ecosystem: maven
1111
directory: /
1212
schedule:
13-
interval: daily
13+
interval: monthly

.github/workflows/cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v5
1414

1515
- name: Set up JDK 11
16-
uses: actions/setup-java@v3
16+
uses: actions/setup-java@v5
1717
with:
1818
java-version: '11'
1919
distribution: 'adopt'
@@ -29,4 +29,4 @@ jobs:
2929
env:
3030
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3131
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
32-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
32+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v5
1111

1212
- name: Set up JDK 11
13-
uses: actions/setup-java@v3
13+
uses: actions/setup-java@v5
1414
with:
1515
java-version: '11'
1616
distribution: 'adopt'
@@ -26,8 +26,9 @@ jobs:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2727

2828
- name: Upload coverage to Codecov
29-
uses: codecov/codecov-action@v2
29+
uses: codecov/codecov-action@v5
3030
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}
3132
directory: ./target/site/jacoco/
3233
fail_ci_if_error: true
33-
verbose: true
34+
verbose: true

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.0.1] - 2025-09-03
10+
### Changed
11+
- Update dependencies
12+
### Fixed
13+
- Fix unit tests on Windows (#18) - thanks to @Zim-Inn
14+
915
## [2.0.0] - 2022-02-02
1016
### Changed
1117
- 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
2026
- Parse json5 data by InputStream / Reader / String
2127
- Serialize json5 data to OutputStream / Writer / String
2228
- Json5Options with builder pattern (Json5OptionsBuilder) to configure Json5
23-
- options: allowInvalidSurrogates, quoteSingle, trailingComma, indentFactor
29+
- options: allowInvalidSurrogates, quoteSingle, trailingComma, indentFactor

pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>de.marhali</groupId>
88
<artifactId>json5-java</artifactId>
9-
<version>2.0.0</version>
9+
<version>2.0.1</version>
1010
<name>${project.groupId}:${project.artifactId}</name>
1111
<description>A lightweight library to parse and serialize JSON5 data</description>
1212
<url>https://github.com/marhali/json5-java</url>
@@ -53,7 +53,7 @@
5353
<dependency>
5454
<groupId>org.junit.jupiter</groupId>
5555
<artifactId>junit-jupiter-engine</artifactId>
56-
<version>5.8.2</version>
56+
<version>5.13.4</version>
5757
<scope>test</scope>
5858
</dependency>
5959
</dependencies>
@@ -63,7 +63,7 @@
6363
<plugin>
6464
<groupId>org.apache.maven.plugins</groupId>
6565
<artifactId>maven-source-plugin</artifactId>
66-
<version>3.2.1</version>
66+
<version>3.3.1</version>
6767
<executions>
6868
<execution>
6969
<id>attach-sources</id>
@@ -76,7 +76,7 @@
7676
<plugin>
7777
<groupId>org.apache.maven.plugins</groupId>
7878
<artifactId>maven-javadoc-plugin</artifactId>
79-
<version>3.3.0</version>
79+
<version>3.11.3</version>
8080
<executions>
8181
<execution>
8282
<id>attach-javadocs</id>
@@ -89,17 +89,17 @@
8989
<plugin>
9090
<groupId>org.apache.maven.plugins</groupId>
9191
<artifactId>maven-surefire-plugin</artifactId>
92-
<version>2.22.2</version>
92+
<version>3.5.3</version>
9393
</plugin>
9494
<plugin>
9595
<groupId>org.apache.maven.plugins</groupId>
9696
<artifactId>maven-failsafe-plugin</artifactId>
97-
<version>2.22.2</version>
97+
<version>3.5.3</version>
9898
</plugin>
9999
<plugin>
100100
<groupId>org.jacoco</groupId>
101101
<artifactId>jacoco-maven-plugin</artifactId>
102-
<version>0.8.7</version>
102+
<version>0.8.13</version>
103103
<executions>
104104
<execution>
105105
<goals>
@@ -126,7 +126,7 @@
126126
<plugin>
127127
<groupId>org.apache.maven.plugins</groupId>
128128
<artifactId>maven-gpg-plugin</artifactId>
129-
<version>3.0.1</version>
129+
<version>3.2.8</version>
130130
<executions>
131131
<execution>
132132
<id>sign-artifact</id>
@@ -149,4 +149,4 @@
149149
</build>
150150
</profile>
151151
</profiles>
152-
</project>
152+
</project>

src/test/java/de/marhali/json5/TestJson5.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import java.io.*;
2323
import java.nio.charset.StandardCharsets;
24+
import java.util.Optional;
2425

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

@@ -45,7 +46,10 @@ private String getTestResourceContent(String fileName) throws IOException {
4546
buf.write((byte) result);
4647
}
4748

48-
return buf.toString(StandardCharsets.UTF_8);
49+
return Optional.ofNullable(buf.toString(StandardCharsets.UTF_8))
50+
.map(s->s.replace("\r\n","\n"))
51+
.map(s->s.replace("\r","\n"))
52+
.orElse(null);
4953
}
5054
}
5155

0 commit comments

Comments
 (0)