Skip to content

Commit

Permalink
Merge pull request #198 from jonasfj/add-fix-data
Browse files Browse the repository at this point in the history
Add `lib/fix_data.yaml` for automatic migration with `dart fix`.
  • Loading branch information
rmconsole6-wk authored Nov 8, 2024
2 parents 2f8c56e + 1c7f663 commit 74ebbcb
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/dart_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ jobs:
- name: Publish - dry run
if: ${{ matrix.sdk == 'stable' }}
run: dart pub publish --dry-run --skip-validation

- name: Test 'dart fix'
# if one of these tests stops working in a future Dart SDK, it may be
# fine to keep entries in lib/fix_data.yaml and just remove the tests.
run: dart fix --compare-to-golden test_fixes/
22 changes: 22 additions & 0 deletions lib/fix_data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 1
transforms:
- title: Rename to validate
date: 2024-10-15
element:
uris:
- json_schema.dart
method: validateWithResults
inClass: Validator
changes:
- kind: rename
newName: validate
- title: Rename to validate
date: 2024-10-15
element:
uris:
- json_schema.dart
method: validateWithResults
inClass: JsonSchema
changes:
- kind: rename
newName: validate
8 changes: 8 additions & 0 deletions test_fixes/rename_to_validate.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:json_schema/json_schema.dart';

void main() {
final schema = JsonSchema.empty();
schema.validateWithResults(null);
final validator = Validator(schema);
validator.validateWithResults(null);
}
8 changes: 8 additions & 0 deletions test_fixes/rename_to_validate.dart.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:json_schema/json_schema.dart';

void main() {
final schema = JsonSchema.empty();
schema.validate(null);
final validator = Validator(schema);
validator.validate(null);
}

0 comments on commit 74ebbcb

Please sign in to comment.