-
Notifications
You must be signed in to change notification settings - Fork 36
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 lib/fix_data.yaml
for automatic migration with dart fix
.
#198
Conversation
These fixes will also show up as "quick fixes" in IDEs. Users do not need to run `dart fix --apply` manually. **Example:** ```dart import 'package:json_schema/json_schema.dart'; void main() { final schema = JsonSchema.empty(); schema.validateWithResults(null); final validator = Validator(schema); validator.validateWithResults(null); } ``` Will be updated by `dart fix --apply` to: ```dart import 'package:json_schema/json_schema.dart'; void main() { final schema = JsonSchema.empty(); schema.validate(null); final validator = Validator(schema); validator.validate(null); } ```
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
I'd love to see a test for this as well if you can do it, since this would be our first usage of this feature and want to make sure it doesn't regress as we add more. Thanks for your contribuitions! |
I added some tests, but testing this might be overkill. If these tests breaks at some point, it might be better to delete them, than trying to maintain the tests. I'm not sure if having untested |
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.
+10
- CI Passes
@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
These fixes will also show up as "quick fixes" in IDEs. Users do not need to run
dart fix --apply
manually.Example:
Will be updated by
dart fix --apply
to:Ultimate problem:
@Deprecated
message onvalidateWithResults
was not automatically migrated.How it was fixed:
Added
lib/fix_data.yaml
with data driven fixes.Testing suggestions:
It's possible to make a
test_fixes/
folder with golden files that can be tested withdart fix --compare-to-golden
however this is probably overkill. See testing.I manually tested this. There is probably no harm in leaving this in place even after 5.0 is released, as it'll probably still facilitate quick fixes for anyone upgrading.
Potential areas of regression:
If these data driven fixes stop working, they aren't likely to cause much harm (they simply won't cause fixes to be suggested).
I mostly made this because I think
fix_data.yaml
is too cool, not to be used 🤣