Skip to content

Commit

Permalink
contribute a fix_data.yaml file to enable 'dart fix' renames (dart-la…
Browse files Browse the repository at this point in the history
…ng#141)

contribute a fix_data.yaml file to enable 'dart fix' renames
  • Loading branch information
devoncarew authored Jan 14, 2024
1 parent 42e86ca commit d17fdd2
Show file tree
Hide file tree
Showing 11 changed files with 2,014 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,23 @@ jobs:
run: dart tool/update_bindings.dart
- name: Analyze code
run: dart analyze --fatal-infos

# Test the contributed `dart fix` fixes.
dart-fix:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [main]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: ${{ matrix.sdk }}
- name: Install Dart dependencies
run: dart pub get
- name: Test the declarative fixes
run: dart fix --compare-to-golden
working-directory: test_fixes
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 0.5.0-wip

- Redeprecate APIs that were deprecated in `0.4.1` but undeprecated in `0.4.2`.
- Add support for `dart fix` migrations from `dart:html` classes to
`package:web` classes.
- Contribute a markdown file for the renamed classes from `dart:html` to
`package:web` (see [renames.md](tool/renames.md)).

## 0.4.2

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ the APIs.
import 'package:web/web.dart';
void main() {
final div = document.querySelector('div') as HTMLDivElement;
final div = document.querySelector('div')!;
div.text = 'Text set at ${DateTime.now()}';
}
```
Expand Down
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ analyzer:
strict-casts: true
strict-inference: true
strict-raw-types: true
exclude:
- test_fixes/**

errors:
# Ideally we'd fix all of these - or ignore them at the line-level where
Expand Down
2 changes: 1 addition & 1 deletion example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
import 'package:web/web.dart';

void main() {
final div = document.querySelector('div') as HTMLDivElement;
final div = document.querySelector('div')!;
div.text = 'Text set at ${DateTime.now()}';
}
Loading

0 comments on commit d17fdd2

Please sign in to comment.