-
Notifications
You must be signed in to change notification settings - Fork 441
Pin SwiftSyntaxBuilder version for generate-swiftsyntaxbuilder #826
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
Pin SwiftSyntaxBuilder version for generate-swiftsyntaxbuilder #826
Conversation
d3fba26
to
04cbd9e
Compare
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.
Looks good, just some minor notes below!
Code-Generation/Package.swift
Outdated
import PackageDescription | ||
|
||
let package = Package( | ||
name: "SwiftSyntaxGeneration", |
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.
Should the package name match the folder name? For consistency, wdyt about naming the package (and the folder) in PascalCase, i.e. CodeGeneration
without the hyphen?
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.
Good catch. I renamed it.
"--gyb-only", | ||
action="store_true", | ||
help=""" | ||
Only generate gyb templates (and not generate-swift-syntax-builder's templates) |
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.
I know this wasn't a change introduced in this PR, but I think Python doesn't automatically dedent multi-line strings like Swift, so we should probably use something like .strip()
or textwrap.dedent
to avoid ending up with strange formatting in the help output.
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.
Good idea. I’ll set up another PR for it.
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.
I just checked and these messages get automatically demented because we use argparse.RawDescriptionHelpFormatter
.
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 interesting, didn't know about that, nice! 👍
04cbd9e
to
f6a4532
Compare
This resolves a bootstrapping issue that running `generate-swiftsyntaxbuilder` might modify `SwiftSyntaxBuilder`, which in turn makes it impossible to build and run `generate-swiftsyntaxbuilder`. Co-Authored-By: fwcd <[email protected]>
Since we pin a SwiftSyntaxBuilder version for generate-swiftsyntaxbuilder, we no longer need to perform gyb-generation in two phases.
f6a4532
to
149604c
Compare
@swift-ci Please test |
This pretty much re-opens #580 on top of current
main
.This resolves a bootstrapping issue that running
generate-swiftsyntaxbuilder
might modifySwiftSyntaxBuilder
, which in turn makes it impossible to build and rungenerate-swiftsyntaxbuilder
.