Skip to content

Commit

Permalink
Update for repo best practices (flutter#14)
Browse files Browse the repository at this point in the history
- Use `pub.dev` links over `dardocs.org`.
- In example, follow `package:pedantic` style for function typed
  argument.
- Drop unused author field from pubspec.
- Use a simpler constraint on `package:meta` since the SDK constraint
  already prevents us from picking up older versions.
  • Loading branch information
natebosch authored Dec 13, 2019
1 parent a288ff9 commit 3b52a74
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ dart:
- 2.1.1

dart_task:
- test
- test: -p vm,chrome

matrix:
include:
- dart: dev
dart_task: dartanalyzer
- dart: dev
dart_task: dartfmt
- dart: dev
dart_task:
dartanalyzer: --fatal-lints --fatal-warnings .
- dart: 2.1.1
dart_task:
dartanalyzer: --fatal-warnings .

# Only building master means that we don't run two builds for each pull request.
branches:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Different `Clock`s can have a different notion of the current time, and the
default top-level [`clock`][]'s notion can be swapped out to reliably test
timing-dependent code.

[`Clock`]: https://www.dartdocs.org/documentation/clock/latest/clock/Clock-class.html
[`clock`]: https://www.dartdocs.org/documentation/clock/latest/clock/clock.html
[`Clock`]: https://pub.dev/documentation/clock/latest/clock/Clock-class.html
[`clock`]: https://pub.dev/documentation/clock/latest/clock/clock.html

For example, you can use `clock` in your libraries like this:

Expand All @@ -14,7 +14,7 @@ For example, you can use `clock` in your libraries like this:
import 'package:clock/clock.dart';
/// Runs [callback] and prints how long it took.
T runWithTiming<T>(T callback()) {
T runWithTiming<T>(T Function() callback) {
var stopwatch = clock.stopwatch()..start();
var result = callback();
print('It took ${stopwatch.elapsed}!');
Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: clock
version: 1.0.2-dev
description: A fakeable wrapper for dart:core clock APIs
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/clock

environment:
sdk: '>=2.1.1 <3.0.0'

dependencies:
meta: '>=0.9.0 <2.0.0'
meta: ^1.0.0

dev_dependencies:
test: ^1.0.0
Expand Down
2 changes: 2 additions & 0 deletions test/stopwatch_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,7 @@ void main() {
});
});
});
}, onPlatform: {
'js': const Skip('Web does not have enough precision'),
});
}

0 comments on commit 3b52a74

Please sign in to comment.