-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Feature request] fix by issue type #47219
Comments
cc @pq |
Here's my use case: Let's say I contribute to a medium or big package is using lints 1.0.0, or even pedantic, and I want to upgrade to lints 2.0.0. After changing the It would be much easier for my team to review a 500-fix change that only fixes one thing, then a 200-fix change that only fixes one other thing. Single-purpose CLs. What is my workflow to produces these changes? Today, its pretty manual: find the name of one lint rule I wish to fix, comment out the It would be very nice if instead, I could specify a diagnostic to fix. Something like |
This would also be helpful for me when preparing internal large-scale bulk changes - part of the review process involves specifying the process you used to produce the bulk change. If the reviewer sees |
I really hope not.
My concern / question is how usable it is to have an interface that requires users to type the names of diagnostic codes. If we're only concerned with lints it might not be too bad because they've likely already typed the name in the analysis options file. Unfortunately, I can't think of anything other than the names that makes any sense. Perhaps the output from Minor nit, but I'd prefer something less lint-specific than The only alternative I can think of is to allow the user to specify the analysis options file on the command-line and have the user create copies. That's probably worse than what we have today. |
+1.
Agreed, 💯 . |
I like the idea for
( |
Both the
It's easy to see which files would be changed and what would be done in each, but hard to see all of the diagnostics that might potentially want to be fixed. If we really want to make it easy to fix a single diagnostic, we might even consider something like
|
I was thinking something similar. 👍 |
@sm2017 |
/fyi @bwilkerson |
Can we make is so that |
That's probably possible. |
See: #47219 I'll follow up with tests for error conditions once diagnostic codes are validated by the protocol (see: https://dart-review.googlesource.com/c/sdk/+/255541). Change-Id: I3318364e952522522608e86bdfdd231839685689 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255544 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Adds details to make applying individual fixes easier. Example output: ``` 3 proposed fixes in 1 file. foo/baz/main.dart annotate_overrides • 1 fix prefer_single_quotes • 2 fixes To fix an individual diagnostic, run one of the following commands: dart fix --apply --code=no_duplicate_case_values . dart fix --apply --code=unused_imports . To fix all diagnostics, run: dart fix --apply . ``` See: #47219 Change-Id: Ibc89388acabe868fe3253d802e03481d853646ac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256367 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
How can I stay updated about when this releases on stable? P.S.: Sorry about the level of this question, I'm just beginning to be part of the community actively. |
This is definitely in Dart 2.19.0. And I think it should be in the recent Dart 2.19.0 dev releases (2.19.0-146.0.dev ish). |
Unfortunately dart fix as only 2 commands as of now
and
I need a way to tell dart to fix only a specific issue? i.e only fix all
Prefer const with constant constructors.
The text was updated successfully, but these errors were encountered: