Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

migrate to null safety #50

Merged
merged 2 commits into from Apr 10, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.10.0-dev

- Migrate to null safety.

## 1.9.0

- Enforce 17 new lint rules:
Expand Down
3 changes: 3 additions & 0 deletions analysis_options.yaml
Expand Up @@ -6,3 +6,6 @@
# including a list of lints that are intentionally _not_ enforced.

include: lib/analysis_options.yaml
analyzer:
enable-experiment:
- non-nullable
16 changes: 16 additions & 0 deletions example/example.dart
@@ -0,0 +1,16 @@
import 'package:pedantic/pedantic.dart';

void main() async {
// Normally, calling a function that returns a Future from an async method
// would require you to ignore the unawaited_futures lint with this analyzer
// syntax:
//
// ignore: unawaited_futures
doSomethingAsync();

// Wrapping it in a call to `unawaited` avoids that, since it doesn't
// return a Future. This is more explicit, and harder to get wrong.
unawaited(doSomethingAsync());
}

Future<void> doSomethingAsync() async {}
2 changes: 1 addition & 1 deletion lib/pedantic.dart
Expand Up @@ -22,4 +22,4 @@ import 'dart:async' show Future;
/// unawaited(log('Preferences saved!'));
/// }
/// ```
void unawaited(Future<void> future) {}
void unawaited(Future<void>? future) {}
4 changes: 2 additions & 2 deletions pubspec.yaml
@@ -1,8 +1,8 @@
name: pedantic
version: 1.9.0
version: 1.10.0-dev
description: >-
The Dart analyzer settings and best practices used internally at Google.
homepage: https://github.com/dart-lang/pedantic

environment:
sdk: '>=2.1.1-dev.0.0 <3.0.0'
sdk: '>=2.8.0-dev <3.0.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change this to <2.8.0 so that only 2.8.-dev sdks can select this release, per other comments.