Require Dart 2.19, use and fix recommended lints (dart-lang/clock#46)
diff --git a/pkgs/clock/.github/workflows/test-package.yml b/pkgs/clock/.github/workflows/test-package.yml
index 70fb7ec..20b28de 100644
--- a/pkgs/clock/.github/workflows/test-package.yml
+++ b/pkgs/clock/.github/workflows/test-package.yml
@@ -47,7 +47,7 @@
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
- sdk: [2.12.0, dev]
+ sdk: [2.19.0, dev]
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
diff --git a/pkgs/clock/CHANGELOG.md b/pkgs/clock/CHANGELOG.md
index 2e04bc4..9d94e5b 100644
--- a/pkgs/clock/CHANGELOG.md
+++ b/pkgs/clock/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.1.2-dev
+
+* Require Dart 2.19
+
## 1.1.1
* Switch to using `package:lints`.
@@ -5,23 +9,7 @@
## 1.1.0
-* Stable release for null safety.
-
-## 1.1.0-nullsafety.3
-
-* Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
- guidelines.
-
-## 1.1.0-nullsafety.2
-
-* Allow prerelease versions of the 2.12 sdk.
-
-## 1.1.0-nullsafety.1
-
-* Allow 2.10 stable and 2.11.0 dev SDK versions.
-
-## 1.1.0-nullsafety
-
+* Update SDK constraints to `>=2.12.0 <3.0.0`.
* Update to null safety.
## 1.0.1
diff --git a/pkgs/clock/analysis_options.yaml b/pkgs/clock/analysis_options.yaml
index 055ac10..9ee7c2b 100644
--- a/pkgs/clock/analysis_options.yaml
+++ b/pkgs/clock/analysis_options.yaml
@@ -1,5 +1,14 @@
-include: package:lints/recommended.yaml
+# https://dart.dev/guides/language/analysis-options
+include: package:dart_flutter_team_lints/analysis_options.yaml
analyzer:
language:
strict-casts: true
+ strict-inference: true
+ strict-raw-types: true
+
+linter:
+ rules:
+ - avoid_private_typedef_functions
+ - avoid_redundant_argument_values
+ - use_super_parameters
diff --git a/pkgs/clock/lib/src/clock.dart b/pkgs/clock/lib/src/clock.dart
index 6079fb3..f6f47de 100644
--- a/pkgs/clock/lib/src/clock.dart
+++ b/pkgs/clock/lib/src/clock.dart
@@ -20,7 +20,7 @@
///
/// This class is designed with testability in mind. The current point in time
/// (or [now()]) is defined by a function that returns a [DateTime]. By
-/// supplying your own time function or using [new Clock.fixed], you can control
+/// supplying your own time function or using [Clock.fixed], you can control
/// exactly what time a [Clock] returns and base your test expectations on that.
///
/// Most users should use the top-level [clock] field, which provides access to
diff --git a/pkgs/clock/pubspec.yaml b/pkgs/clock/pubspec.yaml
index c67030c..3700d4b 100644
--- a/pkgs/clock/pubspec.yaml
+++ b/pkgs/clock/pubspec.yaml
@@ -1,11 +1,11 @@
name: clock
-version: 1.1.1
+version: 1.1.2-dev
description: A fakeable wrapper for dart:core clock APIs.
repository: https://github.com/dart-lang/clock
environment:
- sdk: ">=2.12.0 <3.0.0"
+ sdk: ">=2.19.0 <3.0.0"
dev_dependencies:
- lints: ^1.0.0
+ dart_flutter_team_lints: ^1.0.0
test: ^1.16.0
diff --git a/pkgs/clock/test/clock_test.dart b/pkgs/clock/test/clock_test.dart
index 6c7231c..c457153 100644
--- a/pkgs/clock/test/clock_test.dart
+++ b/pkgs/clock/test/clock_test.dart
@@ -93,7 +93,7 @@
});
test('should return time millis ago', () {
- expect(clock.millisAgo(1000), DateTime(2012, 12, 31, 23, 59, 59, 000));
+ expect(clock.millisAgo(1000), DateTime(2012, 12, 31, 23, 59, 59));
});
test('should return time millis from now', () {
@@ -101,27 +101,27 @@
});
test('should return time seconds ago', () {
- expect(clock.secondsAgo(10), DateTime(2012, 12, 31, 23, 59, 50, 000));
+ expect(clock.secondsAgo(10), DateTime(2012, 12, 31, 23, 59, 50));
});
test('should return time seconds from now', () {
- expect(clock.secondsFromNow(3), DateTime(2013, 1, 1, 0, 0, 3, 0));
+ expect(clock.secondsFromNow(3), DateTime(2013, 1, 1, 0, 0, 3));
});
test('should return time minutes ago', () {
- expect(clock.minutesAgo(10), DateTime(2012, 12, 31, 23, 50, 0, 000));
+ expect(clock.minutesAgo(10), DateTime(2012, 12, 31, 23, 50));
});
test('should return time minutes from now', () {
- expect(clock.minutesFromNow(3), DateTime(2013, 1, 1, 0, 3, 0, 0));
+ expect(clock.minutesFromNow(3), DateTime(2013, 1, 1, 0, 3));
});
test('should return time hours ago', () {
- expect(clock.hoursAgo(10), DateTime(2012, 12, 31, 14, 0, 0, 000));
+ expect(clock.hoursAgo(10), DateTime(2012, 12, 31, 14));
});
test('should return time hours from now', () {
- expect(clock.hoursFromNow(3), DateTime(2013, 1, 1, 3, 0, 0, 0));
+ expect(clock.hoursFromNow(3), DateTime(2013, 1, 1, 3));
});
test('should return time days ago', () {