Skip to content

Commit

Permalink
Merge pull request #63 from davidmorgan/revert-meta
Browse files Browse the repository at this point in the history
Revert dep on meta.
  • Loading branch information
davidmorgan authored Jul 9, 2020
2 parents 2a6fd21 + dbef004 commit c69d70e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.9.2

Revert changes in `1.9.1` due to problems moving `unawaited` to `meta`.

## 1.9.1

`package:meta` is now the recommended place to get the `unawaited` method.
Expand Down
22 changes: 21 additions & 1 deletion lib/pedantic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,24 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

export 'package:meta/meta.dart' show unawaited;
import 'dart:async' show Future;

/// Indicates to tools that [future] is intentionally not `await`-ed.
///
/// In an `async` context, it is normally expected that all [Future]s are
/// awaited, and that is the basis of the lint `unawaited_futures`. However,
/// there are times where one or more futures are intentionally not awaited.
/// This function may be used to ignore a particular future. It silences the
/// `unawaited_futures` lint.
///
/// ```
/// Future<void> saveUserPreferences() async {
/// await _writePreferences();
///
/// // While 'log' returns a Future, the consumer of 'saveUserPreferences'
/// // is unlikely to want to wait for that future to complete; they only
/// // care about the preferences being written).
/// unawaited(log('Preferences saved!'));
/// }
/// ```
void unawaited(Future<void> future) {}
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pedantic
version: 1.9.1
version: 1.9.2
description: >-
The Dart analyzer settings and best practices used internally at Google.
homepage: https://github.com/dart-lang/pedantic
Expand All @@ -8,4 +8,4 @@ environment:
sdk: '>=2.1.1 <3.0.0'

dependencies:
meta: ^1.2.0
meta: ^1.2.2

0 comments on commit c69d70e

Please sign in to comment.