Skip to content

Commit f8c3352

Browse files
authored
fix ci, update analysis options (dart-archive/typed_data#61)
1 parent fdfcc82 commit f8c3352

File tree

8 files changed

+35
-66
lines changed

8 files changed

+35
-66
lines changed

pkgs/typed_data/.github/workflows/test-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
matrix:
4848
# Add macos-latest and/or windows-latest if relevant for this package.
4949
os: [ubuntu-latest]
50-
sdk: [2.12.0, dev]
50+
sdk: [2.17.0, dev]
5151
steps:
5252
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
5353
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46

pkgs/typed_data/CHANGELOG.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.3.2-dev
2+
3+
* Require Dart 2.17
4+
15
## 1.3.1
26

37
* Switch to using `package:lints`.
@@ -6,32 +10,9 @@
610
## 1.3.0
711

812
* Stable release for null safety.
9-
10-
## 1.3.0-nullsafety.5
11-
1213
* Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
1314
guidelines.
1415

15-
## 1.3.0-nullsafety.4
16-
17-
* Allow prerelease versions of the `2.12` sdk.
18-
19-
## 1.3.0-nullsafety.3
20-
21-
* Allow 2.10 stable and 2.11.0 dev SDK versions.
22-
23-
## 1.3.0-nullsafety.2
24-
25-
* Update for the 2.10 dev sdk.
26-
27-
## 1.3.0-nullsafety.1
28-
29-
* Allow the <=2.9.10 stable sdks.
30-
31-
## 1.3.0-nullsafety
32-
33-
* Migrate to NNBD
34-
3516
## 1.2.0
3617

3718
* Add typed queue classes such as `Uint8Queue`. These classes implement both
@@ -45,7 +26,7 @@
4526

4627
## 1.1.5
4728

48-
* Undo unnessesary SDK version constraint tweak.
29+
* Undo unnecessary SDK version constraint tweak.
4930

5031
## 1.1.4
5132

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
1-
include: package:lints/recommended.yaml
1+
include: package:dart_flutter_team_lints/analysis_options.yaml
22

33
analyzer:
44
language:
55
strict-casts: true
66

77
linter:
88
rules:
9-
- avoid_dynamic_calls
10-
- always_declare_return_types
119
- avoid_returning_null
1210
- avoid_unused_constructor_parameters
1311
- cancel_subscriptions
1412
- comment_references
15-
- directives_ordering
1613
- no_adjacent_strings_in_list
17-
- omit_local_variable_types
18-
- only_throw_errors
1914
- package_api_docs
2015
- prefer_const_constructors
21-
- prefer_interpolation_to_compose_strings
22-
- prefer_single_quotes
2316
- test_types_in_equals
24-
- throw_in_finally
25-
- unawaited_futures
26-
- unnecessary_lambdas
27-
- unnecessary_null_aware_assignments
28-
- unnecessary_statements
17+
- use_super_parameters

pkgs/typed_data/lib/src/typed_buffer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,14 @@ abstract class TypedDataBuffer<E> extends ListBase<E> {
308308
}
309309

310310
abstract class _IntBuffer extends TypedDataBuffer<int> {
311-
_IntBuffer(List<int> buffer) : super(buffer);
311+
_IntBuffer(super.buffer);
312312

313313
@override
314314
int get _defaultValue => 0;
315315
}
316316

317317
abstract class _FloatBuffer extends TypedDataBuffer<double> {
318-
_FloatBuffer(List<double> buffer) : super(buffer);
318+
_FloatBuffer(super.buffer);
319319

320320
@override
321321
double get _defaultValue => 0.0;

pkgs/typed_data/lib/src/typed_queue.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ abstract class _TypedQueue<E, L extends List<E>> with ListMixin<E> {
223223
}
224224
}
225225
} else if (targetIsContiguous) {
226-
// If the range is contiguous within the table, we can set it with a single
227-
// underlying [setRange] call.
226+
// If the range is contiguous within the table, we can set it with a
227+
// single underlying [setRange] call.
228228
_table.setRange(targetStart, targetEnd, iterable, skipCount);
229229
} else if (iterable is List<E>) {
230230
// If the range isn't contiguous and [iterable] is actually a [List] (but
@@ -337,15 +337,15 @@ abstract class _TypedQueue<E, L extends List<E>> with ListMixin<E> {
337337
}
338338

339339
abstract class _IntQueue<L extends List<int>> extends _TypedQueue<int, L> {
340-
_IntQueue(L queue) : super(queue);
340+
_IntQueue(super.queue);
341341

342342
@override
343343
int get _defaultValue => 0;
344344
}
345345

346346
abstract class _FloatQueue<L extends List<double>>
347347
extends _TypedQueue<double, L> {
348-
_FloatQueue(L queue) : super(queue);
348+
_FloatQueue(super.queue);
349349

350350
@override
351351
double get _defaultValue => 0.0;
@@ -644,12 +644,13 @@ class Int32x4Queue extends _TypedQueue<Int32x4, Int32x4List>
644644
/// time-efficient than a default [QueueList] implementation.
645645
class Float32x4Queue extends _TypedQueue<Float32x4, Float32x4List>
646646
implements QueueList<Float32x4> {
647-
/// Creates an empty [Float32x4Queue] with the given initial internal capacity (in
648-
/// elements).
647+
/// Creates an empty [Float32x4Queue] with the given initial internal capacity
648+
/// (in elements).
649649
Float32x4Queue([int? initialCapacity])
650650
: super(Float32x4List(_chooseRealInitialCapacity(initialCapacity)));
651651

652-
/// Creates a [Float32x4Queue] with the same length and contents as [elements].
652+
/// Creates a [Float32x4Queue] with the same length and contents as
653+
/// [elements].
653654
factory Float32x4Queue.fromList(List<Float32x4> elements) =>
654655
Float32x4Queue(elements.length)..addAll(elements);
655656

pkgs/typed_data/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: typed_data
2-
version: 1.3.1
2+
version: 1.3.2-dev
33
description: >-
44
Utility functions and classes related to the dart:typed_data library.
55
repository: https://github.com/dart-lang/typed_data
66

77
environment:
8-
sdk: ">=2.12.0 <3.0.0"
8+
sdk: ">=2.17.0 <3.0.0"
99

1010
dependencies:
1111
collection: ^1.15.0
1212

1313
dev_dependencies:
14-
lints: ^1.0.0
14+
dart_flutter_team_lints: ^0.1.0
1515
test: ^1.16.0

pkgs/typed_data/test/queue_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// ignore_for_file: avoid_function_literals_in_foreach_calls
66

77
import 'package:test/test.dart';
8-
98
import 'package:typed_data/typed_data.dart';
109

1110
/// The initial capacity of queues if the user doesn't specify one.
@@ -110,8 +109,8 @@ void main() {
110109
});
111110

112111
group(
113-
'sets a range to a section of the same queue overlapping at the beginning',
114-
() {
112+
'sets a range to a section of the same queue overlapping at the '
113+
'beginning', () {
115114
forEachInternalRepresentation((queue) {
116115
queue.setRange(5, 10, queue, 2);
117116
expect(queue, [1, 2, 3, 4, 5, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15]);

pkgs/typed_data/test/typed_buffers_test.dart

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,29 @@ void main() {
4444
}
4545

4646
void initTests(List<int> intSamples) {
47-
testUint(intSamples, 8, (l) => Uint8Buffer(l));
48-
testInt(intSamples, 8, (l) => Int8Buffer(l));
47+
testUint(intSamples, 8, Uint8Buffer.new);
48+
testInt(intSamples, 8, Int8Buffer.new);
4949
test('Uint8ClampedBuffer', () {
50-
testIntBuffer(
51-
intSamples, 8, 0, 255, (l) => Uint8ClampedBuffer(l), clampUint8);
50+
testIntBuffer(intSamples, 8, 0, 255, Uint8ClampedBuffer.new, clampUint8);
5251
});
53-
testUint(intSamples, 16, (l) => Uint16Buffer(l));
54-
testInt(intSamples, 16, (l) => Int16Buffer(l));
55-
testUint(intSamples, 32, (l) => Uint32Buffer(l));
52+
testUint(intSamples, 16, Uint16Buffer.new);
53+
testInt(intSamples, 16, Int16Buffer.new);
54+
testUint(intSamples, 32, Uint32Buffer.new);
5655

57-
testInt(intSamples, 32, (l) => Int32Buffer(l));
56+
testInt(intSamples, 32, Int32Buffer.new);
5857

59-
testUint(intSamples, 64, (l) => Uint64Buffer(l),
58+
testUint(intSamples, 64, Uint64Buffer.new,
6059
// JS doesn't support 64-bit ints, so only test this on the VM.
6160
testOn: 'dart-vm');
62-
testInt(intSamples, 64, (l) => Int64Buffer(l),
61+
testInt(intSamples, 64, Int64Buffer.new,
6362
// JS doesn't support 64-bit ints, so only test this on the VM.
6463
testOn: 'dart-vm');
6564

6665
testInt32x4Buffer(intSamples);
6766

6867
var roundedFloatSamples = floatSamples.map(roundToFloat).toList();
69-
testFloatBuffer(32, roundedFloatSamples, () => Float32Buffer(), roundToFloat);
70-
testFloatBuffer(64, doubleSamples, () => Float64Buffer(), (x) => x);
68+
testFloatBuffer(32, roundedFloatSamples, Float32Buffer.new, roundToFloat);
69+
testFloatBuffer(64, doubleSamples, Float64Buffer.new, (x) => x);
7170

7271
testFloat32x4Buffer(roundedFloatSamples);
7372

@@ -557,7 +556,7 @@ class MatchesInt32x4 extends Matcher {
557556
description.add('Int32x4.==');
558557

559558
@override
560-
bool matches(item, Map matchState) =>
559+
bool matches(Object? item, Map matchState) =>
561560
item is Int32x4 &&
562561
result.x == item.x &&
563562
result.y == item.y &&

0 commit comments

Comments
 (0)