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
quick fix for diagnostic_describe_all_properties #38633
Comments
@goderbauer Could you send us a couple of before/after pairs? That would likely be very helpful for informing what the fix should do. |
I can provide all the before and after pairs. For each case the quick fix is to either add a line at the end of the existing |
That should be fairly easy to automate. Given the amount of work there is it sounds like we should also consider enabling that via dartfix, which could apply the fix in bulk. |
There would still be a bit of manual work to make sure the properties have
the right default values and determine whether each property shouldn't be
added or not so lets hold up on dartfix integration.
…On Sat, Sep 28, 2019 at 9:35 PM Brian Wilkerson ***@***.***> wrote:
That should be fairly easy to automate. Given the amount of work there is
it sounds like we should also consider enabling that via dartfix, which
could apply the fix in bulk.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#38633?email_source=notifications&email_token=AAJLQPG72DULJTHGEATY3L3QMAWCBA5CNFSM4I3OJ24KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73H6ZQ#issuecomment-536248166>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJLQPBXVM2KNZZRA6P2OBLQMAWCBANCNFSM4I3OJ24A>
.
|
How do you manually determine the default value for a property? Is it possible to statically determine the right default value for a property? Maybe by looking at the field's initializer and/or the constructors? How do you manually determine which properties to add? I would have assumed that the lint was able to do this in order to not produce false positives. If that's not the case then we should at least be able to add an 'ignore' comment for properties that shouldn't be added. If you do that, then those diagnostics will be suppressed and given that fixes are only applied where a diagnostic is reported, we should still be able to use dartfix after marking the properties that shouldn't be added. |
very constrained support for fixing `diagnostic_describe_all_properties` for the boolean field case. still todo: * tests for no debugFillProperties method * tests for getters * support for ColorProperty -- for Color * support for EnumProperty -- for any enum class * support for IntProperty -- int * support for DoubleProperty -- double * support for IterableProperty -- any iterable * support for StringProperty -- string * support for TransformProperty -- Matrix4 * support for DiagnosticsProperty for any T that doesn't match one of the other cases (at least) See: #38633 Change-Id: Ie6875f49914e54d3b4539fcb51a231da688bdf18 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119536 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: Iac5523b90f3f753107cf5dc22c3cd211a21ae040 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119681 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Adds support for: * ints * doubles * enums * Strings Up next: Colors, Iterables, Transforms and a catch-all. Also note the TODO to change how types are being written (will be needed for Iterables). See: #38633 Change-Id: I9d545ce9e090059ae330f9ae5dadf8e7d4b373c7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119725 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
See: #38633 Change-Id: I8d7baa32bcea22f2c162bd9d77c7dd0b95b308de Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119901 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
…f undefined See: #38633 Change-Id: If82922a38243e144ad2ec0038d8642c17f458df8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120140 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
See: #38633 Change-Id: I5fd1328a5ad234e6216631007ecbcc459bfa36e9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120340 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
Video demonstrating the simple/common case... 🤘 /cc @jacob314 |
For reference: dart-lang/linter#1420. |
See: #38633 Change-Id: Ie10dcde92e0e054271fe0e965ed810ac3834120b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121160 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
See: #38633 Follow-up from: flutter/flutter#42447 (comment) Change-Id: Idd3cbc4b3419e792d6b81e02bd556b35faaef8c7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121770 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
Follow-up from: flutter/flutter#41513 (comment).
@jacob314: feel free to chime in w/ any implementation notes here. Any heuristics for code generation would be greatly appreciated!
Property subclasses to support
The text was updated successfully, but these errors were encountered: