Closed lbhfuture closed 1 month ago
Hi! Thanks for opening your first issue here! :smile:
dart fix
dart fix
" feature (which is quite useful in some scenarios) - maybe we should at least make a bool flag for this feature?The tricky part is that dart fix
does not support for fixing a single file. We can support opt-out of the feature first, then consider further support with handling a specific batch of files.
Totally agree!
Oh, I just ran dart fix --apply ./dir_name
and it works.
I tried it a bit:
dart fix --apply ./lib/main.dart ./lib/src/rust/frb_generated.dart
Only one file or directory is expected.
Usage: dart fix [arguments]
-h, --help Print this usage information.
-n, --dry-run Preview the proposed changes but make no changes.
--apply Apply the proposed changes.
--code=<code1,code2,...> Apply fixes for one (or more) diagnostic codes.
Run "dart help" to see global options
But we should not run dart fix
one time for each file/folder, otherwise it may be slow... (not tested though; if running multiple ones does not have overhead, then this looks pretty reasonable)
Maybe we can also create/find an issue at Dart repo asking for supporting multiple file/folders
We can only apply to dart_output
, don't we?
Yes and no. Yes because usually that folder should only be touched by frb and not but normal users; no because theoretically we did not forbid users from adding any extra files there...
So I guess a workaround is to only apply to that folder, and if there rare latter case happens, we can tell users to move their files or to accept the fix.
no because theoretically we did not forbid users from adding any extra files there...
Fair enough. We can improve our guides and warnings to tell users not to put extra files into the output path as the best practice.
Related: https://github.com/fzyzcjy/flutter_rust_bridge/discussions/2328
(manually add this comment since github does not auto backlink between discussion and issues)
Just upgraded from flutter_rust_bridge 2.0.0 to 2.4.0 and this issue surprised me lol
Anyway, it's time to make Dart analyzer happy.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Describe the bug
I run
flutter_rust_bridge_codegen integrate
to add frb to my existed project, and it modified my codes which is not generated by frb.The console shows:
The formatter above should only modify dart code in lib/src/rust, but it seems not works well, and my
flutter_rust_bridge.yaml
is below:frb version is 2.4.0
Steps to reproduce
flutter_rust_bridge_codegen integrate
to add frb to a existed project.Logs
Expected behavior
No response
Generated binding code
No response
OS
MacOS
Version of
flutter_rust_bridge_codegen
2.4.0
Flutter info
No response
Version of
clang++
No response
Additional context
No response