-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[tool] Use swift-format from Xcode
#9460
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
Conversation
|
@jmagman / @vashworth Any objection to this approach of just unconditionally using We could still do that version, if we wanted to support overriding the |
| /// Options for open panels. | ||
| /// | ||
| /// These correspond to NSOpenPanel properties. | ||
| class OpenPanelOptions extends SavePanelOptions { |
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.
This change preserves the old behavior. When I first wrote this I used inheritance out of habit, but that didn't actually do anything in Pigeon at the time. I fixed it by adding composition (line 62 below), but forgot to remove this extends that was being ignored.
In the current Pigeon this is an error, because inheritance does work, but only to inherit from a sealed empty base class to allow type switching.
cbracken
left a comment
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.
| argParser.addFlag(_javaArg, help: 'Format Java files', defaultsTo: true); | ||
| argParser.addFlag(_swiftArg, | ||
| help: 'Format and lint Swift files', defaultsTo: true); | ||
| help: 'Format and lint Swift files', defaultsTo: platform.isMacOS); |
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.
fyi: Nothing to do for this patch, but it looks like swift-format is open source https://github.com/swiftlang/swift-format and tagged for various releases if we one did want to support this on Linux as well.
No objection. We should document how to add this back somewhere in case we do want to use it again. |
vashworth
left a comment
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.
LGTM
I'll add a comment with some context and a link to this PR on the constructor line that makes it default to on for macOS only. |
|
CHANGELOG/version override: |
|
autosubmit label was removed for flutter/packages/9460, because - The status or check suite Linux_android android_device_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/packages/9460, because - The status or check suite Linux_android android_platform_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/packages/9460, because - The status or check suite Linux_android android_platform_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
jmagman
left a comment
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.
Thank you!
flutter/packages@5963ecd...2c8d2bc 2025-06-26 [email protected] Bump AVD and SDK to API 36 in Packages CI (flutter/packages#9414) 2025-06-26 [email protected] [tool] Use `swift-format` from Xcode (flutter/packages#9460) 2025-06-26 [email protected] Revert "[camera_android_camerax] Force new `Surface` for each `SurfaceRequest`" (flutter/packages#9500) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@5963ecd...2c8d2bc 2025-06-26 [email protected] Bump AVD and SDK to API 36 in Packages CI (flutter/packages#9414) 2025-06-26 [email protected] [tool] Use `swift-format` from Xcode (flutter/packages#9460) 2025-06-26 [email protected] Revert "[camera_android_camerax] Force new `Surface` for each `SurfaceRequest`" (flutter/packages#9500) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
As of Xcode 16, `swift-format` is part of the Xcode distribution. Since CI now uses Xcode 16, we can just always use that version. This: - Removes the `swift-format-path` logic. - Removes the check for `swift-format` being available - Defaults Swift formatting to true only on macOS - Removes the `swift-format` CIPD package from .ci.yaml - Updates Pigeon in packages using Swift Pigeon generation to pick up a fix for a lint issue picked up by the latest version of `swift-format` (which was already fixed in Pigeon). Fixes flutter/flutter#153803 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
flutter/packages@5963ecd...2c8d2bc 2025-06-26 [email protected] Bump AVD and SDK to API 36 in Packages CI (flutter/packages#9414) 2025-06-26 [email protected] [tool] Use `swift-format` from Xcode (flutter/packages#9460) 2025-06-26 [email protected] Revert "[camera_android_camerax] Force new `Surface` for each `SurfaceRequest`" (flutter/packages#9500) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

As of Xcode 16,
swift-formatis part of the Xcode distribution. Since CI now uses Xcode 16, we can just always use that version.This:
swift-format-pathlogic.swift-formatbeing availableswift-formatCIPD package from .ci.yamlswift-format(which was already fixed in Pigeon).Fixes flutter/flutter#153803
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3