Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[pigeon] Improve Swift generator output style #141799

Closed
flutter/packages
#5938
@stuartmorgan-g

Description

@stuartmorgan-g

Running swift-format over the Pigeon-generated output turned up a bunch of places where our generator output doesn't match formatted output. While we don't need it to be perfectly formatted, we do generally want to match expected style in the initial generation. And in a number of cases, the output is distinctly non-idiomatic, like parens in if statements.

Some things to fix based on initial skim (but when doing this we should iterate a bit with the autoformatter and try to fix anything that's relatively straightforward):

  • if statements should not use ()s.
  • cases should not be indented relative to the switch
  • Conditional imports should be indented
  • Multi-line arrays should use trailing commas
  • Named params should have a space after :, which is missing in some places

Metadata

Metadata

Labels

P3Issues that are less important to the Flutter projectp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyplatform-macBuilding on or for macOS specificallyteam-ecosystemOwned by Ecosystem team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions