Skip to content

Commit

Permalink
Merge pull request #68 from evenlyio/master
Browse files Browse the repository at this point in the history
Use .sortedKeys for JSONEncoder, so output is stable
  • Loading branch information
FelixHerrmann authored Oct 30, 2023
2 parents ef3c05e + 670c6d6 commit c4ec56f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct JSONGenerator: OutputGenerator {

private let jsonEncoder: JSONEncoder = {
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
return encoder
}()

Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftPackageListCoreTests/JSONGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ final class JSONGeneratorTests: XCTestCase {
let expectedOutput = """
[
{
"revision" : "xxxx",
"license" : "MIT",
"name" : "test",
"repositoryURL" : "https:\\/\\/github.com\\/test\\/test",
"revision" : "xxxx",
"version" : "1.0.0"
}
]
Expand Down

0 comments on commit c4ec56f

Please sign in to comment.