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

[dartgen] Add ability to customize format options for dartgen command #4412

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fondoger
Copy link
Contributor

@fondoger fondoger commented Oct 6, 2024

Currently, when running goctl api dart ... to generate dart API files, the dart formatter will be triggered automatically. But it always uses the default configurations when formatting the dart files.

This PR adds a feature to allow users to override the default dart format parameters. So the formatted dart file obeys the lint rules of the existing dart project.

Before:

goctl api dart -api server.api -dir ../app/api

=> `dart format <dir>`

After:

goctl api dart -api server.api -dir ../app/api -format-args "--line-length=150"

=> `dart format <dir> --line-length=150`

The current behavior is not affected.

Copy link

codecov bot commented Oct 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.04%. Comparing base (8690859) to head (a925e10).
Report is 153 commits behind head on master.

Additional details and impacted files

see 255 files with indirect coverage changes

@kevwan kevwan force-pushed the fondoger/dart-format-options branch from 5c995b4 to a925e10 Compare October 15, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant