You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Dart package ecosystem, most of the packages are using source_gen which formats the output code. This process has 2 main benefits:
The generator can just produce valid code and not care about indentation, carriage returns, etc. since the output is formatted at the end anyway
The developer can run dart format . and there is no change in the generated code since it has already been formatted that way.
I have started using slang and everytime I run dart run slang, I have to run dart format . and commit the changes otherwise my CI build is broken.
There is no way to exclude file in Dart formatter (yet) dart-lang/dart_style#864 so having generated code properly formatted like code gen packages do would be great.
To repro:
Clone the slang repo
Run cd slang/example
Run flutter pub get
Run dart format .
Run git diff 👉 There are some changes that shouldn't be here.
The text was updated successfully, but these errors were encountered:
A temporary workaround is to remove the generated file inside the CI before running dart format .. This essentially ignores the file as it doesn't exist anymore.
Integrating source_gen requires a lot of effort so it is unlikely in the near future.
In the Dart package ecosystem, most of the packages are using source_gen which formats the output code. This process has 2 main benefits:
dart format .
and there is no change in the generated code since it has already been formatted that way.I have started using slang and everytime I run
dart run slang
, I have to rundart format .
and commit the changes otherwise my CI build is broken.There is no way to exclude file in Dart formatter (yet) dart-lang/dart_style#864 so having generated code properly formatted like code gen packages do would be great.
To repro:
cd slang/example
flutter pub get
dart format .
git diff
👉 There are some changes that shouldn't be here.The text was updated successfully, but these errors were encountered: