-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add import sorting to format tool (backpatch to v3.7.1) #381
Conversation
- Reviewer note: This is copied from dart_dev_workiva for easy reviewing. - This should only contain import changes
- This will allow us to execute multiple processes as part of a `ddev format` command
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
806b81d
to
474cef5
Compare
- I would rather follow Effective Dart guidelines. directives_ordering no longer separates own package from other package. See https://dart.dev/guides/language/effective-dart/style#ordering - prefer_relative_imports seems like a better alternative for packages that wish to separate own package imports https://dart.dev/guides/language/effective-dart/usage#prefer-relative-import-paths
474cef5
to
91d86d7
Compare
Will I have to add a |
- Prefer `organize` over `clean` or `sort` (unless specifically referencing sorting)
Co-authored-by: Evan Weible <[email protected]>
- This makes it clear that assigning comments has to happen before sorting - This is slightly less stateful than before, which feels slightly better
8dc9747
to
17d6e60
Compare
@regenvanwalbeek-wf could you add a changelog entry for 3.7.2? I can't quite remember how backpatch releases work, so it's possible this may end up effectively being the release PR. I've updated MARV with the correct version. |
🔍 Should this be a |
Unfortunately since we're back patching, we're a bit limited since 3.8.x already exists. Ideally we would only be backpatching bugs, but I think we're alright to just call this a patch release anyway. Edit: what I mean is that since we're adding this public API here and on the latest 3.x branch, it should be relatively safe. Consumers who use the API from 3.7.2 will still have the API when they are able to upgrade to latest. |
That makes sense. Pushed! |
QA +1
|
@Workiva/release-management-p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from RM
Note: This is a backpatch to 3.7.1 for consumers who have not upgraded to analyzer 1.0.0 - The changes for the mainline branch exist here
Having to manually sort imports is tedious. It would be better if we could just run the formatter to receive sorted imports.
I added an
organizeImports
flag to theFormatTool
. When set to true, it will also run the file through an import sorter.The import sorter tries to comply with https://dart.dev/tools/linter-rules#directives_ordering