Skip to content

contribute a fix_data.yaml file to enable 'dart fix' renames #141

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

Merged
merged 6 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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