Open ncuillery opened 9 months ago
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.
Having the same problem. Would wish this feature to be implemented.
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) https://github.com/dart-lang/dart_style/issues/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.