-
Notifications
You must be signed in to change notification settings - Fork 249
Refactored file generation logic to be string-based and added validation tests #1047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a48a3d4
to
54b607f
Compare
Hmm... It seems that string handling behaves a bit differently on Windows 🤔 |
54b607f
to
ec3fb2b
Compare
To resolve the linker error caused by adding the I'm still investigating the test case failures on Windows. |
97185d5
to
1f62c5d
Compare
The test failure was caused by |
1f62c5d
to
58c01a2
Compare
Package.swift
Outdated
@@ -58,6 +58,11 @@ var targets: [Target] = [ | |||
"SwiftOperators", "SwiftParser", "SwiftParserDiagnostics", "SwiftSyntax", "SwiftSyntaxBuilder", | |||
]) | |||
), | |||
.target( | |||
name: "GenerateSwiftFormat", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's name this (and the directory) _GenerateSwiftFormat
, as a signal to users that this target shouldn't be used directly by anyone.
Package.swift
Outdated
"SwiftFormat" | ||
] | ||
dependencies: ["GenerateSwiftFormat"], | ||
path: "Sources/generate-swift-format" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it can be omitted. I've also incorporated the remaining changes. Thanks!
XCTAssertEqual( | ||
generated, | ||
fileContents.normalizeNewlines(), | ||
"Pipelines+Generated.swift is out of date. Run generate-swift-format." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give the full command to make it easier for contributors:
Whatever.swift is out of date. Please run 'swift run generate-swift-format'.
58c01a2
to
068b561
Compare
Resolve #1045
Changed the file generation logic to be string-based and added validation tests for each generated file.
Confirmed that it behaves the same as before 🫡