Skip to content
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

[tool] Add Kotlin autoformatting #5374

Merged
merged 6 commits into from
Nov 13, 2023
Merged

Conversation

stuartmorgan
Copy link
Contributor

Updates the tooling to fetch and use ktfmt for Kotlin code, the same way it currently does for the Google Java formatter, and applies that formatting (in the default mode; see discussion in the linked issue) to the repository.

In the future we could revisit the formatter or mode, but since this currently seems to be the most consistent with our other languages and to google3 formatting this is likely the option we'll want to stick with.

Fixes flutter/flutter#118756

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@stuartmorgan
Copy link
Contributor Author

@reidbaker I'll wait for your approval on this as the primary stakeholder who hasn't weighed in yet.

Everyone else can ignore this; it touched a lot of examples which force-added a lot of reviewers :(

@stuartmorgan stuartmorgan added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label Nov 12, 2023
@stuartmorgan
Copy link
Contributor Author

Overriding changelog: The app boilerplate changes are uninteresting to package clients.

@stuartmorgan stuartmorgan added the override: no versioning needed Override the check requiring version bumps for most changes label Nov 12, 2023
@stuartmorgan
Copy link
Contributor Author

Overriding version: There's minor formatting change to the Pigeon README which can go out in the next Pigeon release (we have several lined up, and skipping the versioning here avoids conflicts in those).

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 13, 2023
@auto-submit auto-submit bot merged commit 72de224 into flutter:main Nov 13, 2023
81 checks passed
@stuartmorgan stuartmorgan deleted the kotlin-format branch November 13, 2023 16:25
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 14, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 14, 2023
flutter/packages@17bd92e...428ba3e

2023-11-13 [email protected] [pigeon] Remove semicolons from Kotlin generation (flutter/packages#5375)
2023-11-13 [email protected] [tool] Add Kotlin autoformatting (flutter/packages#5374)

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],[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
HugoOlthof pushed a commit to moneybird/packages that referenced this pull request Dec 13, 2023
Updates the tooling to fetch and use `ktfmt` for Kotlin code, the same way it currently does for the Google Java formatter, and applies that formatting (in the default mode; see discussion in the linked issue) to the repository.

In the future we could revisit the formatter or mode, but since this currently seems to be the most consistent with our other languages and to google3 formatting this is likely the option we'll want to stick with.

Fixes flutter/flutter#118756
@reidbaker reidbaker mentioned this pull request Jan 12, 2024
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
Updates the tooling to fetch and use `ktfmt` for Kotlin code, the same way it currently does for the Google Java formatter, and applies that formatting (in the default mode; see discussion in the linked issue) to the repository.

In the future we could revisit the formatter or mode, but since this currently seems to be the most consistent with our other languages and to google3 formatting this is likely the option we'll want to stick with.

Fixes flutter/flutter#118756
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: animations p: dynamic_layouts The dynamic_layouts package p: file_selector p: flutter_adaptive_scaffold p: flutter_image p: flutter_markdown p: go_router p: palette_generator p: pigeon p: rfw Remote Flutter Widgets platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[packages] Add support for Kotlin auto-formatting
2 participants